You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/bin/pgaccess/lib/database.tcl
+12-15Lines changed: 12 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -4,24 +4,21 @@ proc {getTablesList} {} {
4
4
global CurrentDB PgAcVar
5
5
set tlist {}
6
6
if {[catch {
7
-
wpg_select $CurrentDB"select c.relname,count(c.relname) from pg_class C, pg_rewrite R where (r.ev_class = C.oid) and (r.ev_type = '1') group by relname" rec {
8
-
if {$rec(count)!=0} {
9
-
set itsaview($rec(relname)) 1
10
-
}
7
+
# As of Postgres 7.1, testing for view-ness is not needed
8
+
# because relkind = 'r' eliminates views. But we should
9
+
# leave the code in for awhile yet, so as not to fail when
10
+
# running against older releases.
11
+
wpg_select $CurrentDB"select viewname from pg_views" rec {
12
+
set itsaview($rec(viewname)) 1
11
13
}
12
14
if {! $PgAcVar(pref,systemtables)} {
13
-
wpg_select $CurrentDB"select relname from pg_class where (relname !~ '^pg_') and (relkind='r') order by relname" rec {
14
-
if {![regexp"^pga_"$rec(relname)]} then {
15
-
if {![info exists itsaview($rec(relname))]} {
16
-
lappend tlist $rec(relname)
17
-
}
18
-
}
19
-
}
15
+
set sysconstraint "and (relname !~ '^pg_') and (relname !~ '^pga_')"
20
16
} else {
21
-
wpg_select $CurrentDB"select relname from pg_class where (relkind='r') order by relname" rec {
22
-
if {![info exists itsaview($rec(relname))]} {
23
-
lappend tlist $rec(relname)
24
-
}
17
+
set sysconstraint ""
18
+
}
19
+
wpg_select $CurrentDB"select relname from pg_class where (relkind='r') $sysconstraint order by relname" rec {
Copy file name to clipboardExpand all lines: src/bin/pgaccess/lib/mainlib.tcl
+7-9Lines changed: 7 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -295,19 +295,17 @@ catch {
295
295
}
296
296
297
297
proc{cmd_Views} {} {
298
-
global CurrentDB
298
+
global CurrentDB PgAcVar
299
299
setCursor CLOCK
300
300
.pgaw:Main.lb delete 0 end
301
301
catch {
302
-
wpg_select $CurrentDB"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 {
303
-
if {$rec(count)!=0} {
304
-
set itsaview($rec(relname)) 1
305
-
}
302
+
if {! $PgAcVar(pref,systemtables)} {
303
+
set sysconstraint "where (viewname !~ '^pg_') and (viewname !~ '^pga_')"
304
+
} else {
305
+
set sysconstraint ""
306
306
}
307
-
wpg_select $CurrentDB"select relname from pg_class where (relname !~ '^pg_') and (relkind='r') and (relhasrules) order by relname" rec {
308
-
if {[info exists itsaview($rec(relname))]} {
309
-
.pgaw:Main.lb insert end $rec(relname)
310
-
}
307
+
wpg_select $CurrentDB"select viewname from pg_views $sysconstraint order by viewname" rec {
0 commit comments