@@ -288,6 +291,7 @@ set objname [.dw.lb get [.dw.lb curselection]]
...
@@ -288,6 +291,7 @@ set objname [.dw.lb get [.dw.lb curselection]]
set tablename $objname
set tablename $objname
switch $activetab {
switch $activetab {
Queries {open_query design}
Queries {open_query design}
Views {open_view_design}
Scripts {design_script $objname}
Scripts {design_script $objname}
Forms {fd_load_form $objname design}
Forms {fd_load_form $objname design}
Reports {
Reports {
...
@@ -343,25 +347,21 @@ cursor_normal
...
@@ -343,25 +347,21 @@ cursor_normal
proc {cmd_Functions}{}{
proc {cmd_Functions}{}{
global dbc
global dbc
set maxim 0
set maxim 16384
set pgid 0
cursor_clock
cursor_clock
catch {
catch {
wpg_select $dbc "select proowner,count(*) from pg_proc group by proowner" rec {
wpg_select $dbc "select oid from pg_database where datname='template1'" rec {
if {$rec(count)>$maxim}{
set maxim $rec(oid)
set maxim $rec(count)
set pgid $rec(proowner)
}
}
}
}
.dw.lb delete 0 end
.dw.lb delete 0 end
catch {
catch {
wpg_select $dbc "select proname from pg_proc where prolang=14 and proowner<>$pgid order by proname" rec {
wpg_select $dbc "select proname from pg_proc where prolang=14 and oid>$maxim order by proname" rec {
.dw.lb insert end $rec(proname)
.dw.lb insert end $rec(proname)
}
}
}
}
cursor_normal
cursor_normal
}
}
}
proc {cmd_Import_Export}{how}{
proc {cmd_Import_Export}{how}{
global dbc ie_tablename ie_filename activetab
global dbc ie_tablename ie_filename activetab
...
@@ -397,7 +397,7 @@ switch $activetab {
...
@@ -397,7 +397,7 @@ switch $activetab {
Window show .qb
Window show .qb
set queryoid 0
set queryoid 0
set queryname {}
set queryname {}
set cbv 0
set cbv 0
.qb.cbv configure -state normal
.qb.cbv configure -state normal
}
}
Users {
Users {
...
@@ -585,12 +585,18 @@ cursor_normal
...
@@ -585,12 +585,18 @@ cursor_normal
proc {cmd_Views}{}{
proc {cmd_Views}{}{
global dbc
global dbc
cursor_clock
cursor_clock
.dw.lb delete 0 end
.dw.lb delete 0 end
catch {
catch {
wpg_select $dbc "select c.relname,count(c.relname) from pg_class C, pg_rewrite R where (relname !~ '^pg_') and (r.ev_class = C.oid) and (r.ev_type = '1') group by relname" rec {
if {$rec(count)!=0}{
set itsaview($rec(relname)) 1
}
}
wpg_select $dbc "select relname from pg_class where (relname !~ '^pg_') and (relkind='r') and (relhasrules) order by relname" rec {
wpg_select $dbc "select relname from pg_class where (relname !~ '^pg_') and (relkind='r') and (relhasrules) order by relname" rec {
.dw.lb insert end $rec(relname)
if {[info exists itsaview($rec(relname))]}{
.dw.lb insert end $rec(relname)
}
}
}
}
}
cursor_normal
cursor_normal
...
@@ -602,7 +608,7 @@ if {[winfo exists $base.ddf]} {
...
@@ -602,7 +608,7 @@ if {[winfo exists $base.ddf]} {
wpg_select $dbc "select * from pg_class where (relname !~ '^pg_') and (relkind='r') order by relname" rec {
wpg_select $dbc "select c.relname,count(c.relname) from pg_class C, pg_rewrite R where (relname !~ '^pg_') and (r.ev_class = C.oid) and (r.ev_type = '1') group by relname" rec {
if {![regexp "^pga_" $rec(relname)]} then {lappend tbl $rec(relname)}
if {$rec(count)!=0}{
set itsaview($rec(relname)) 1
}
}
wpg_select $dbc "select relname from pg_class where (relname !~ '^pg_') and (relkind='r') order by relname" rec {