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/tables.tcl
+21-4Lines changed: 21 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ global PgAcVar CurrentDB
44
44
set PgAcVar(tblinfo,isunique) {}
45
45
set PgAcVar(tblinfo,isclustered) {}
46
46
set PgAcVar(tblinfo,indexfields) {}
47
-
wpg_select $CurrentDB"select attnum,attname,typname,attlen,attnotnull,atttypmod,usename,usesysid,pg_class.oid,relpages,reltuples,relhasrules,relacl from pg_class,pg_user,pg_attribute,pg_type where (pg_class.relname='$PgAcVar(tblinfo,tablename)') and (pg_class.oid=pg_attribute.attrelid) and (pg_class.relowner=pg_user.usesysid) and (pg_attribute.atttypid=pg_type.oid) order by attnum" rec {
47
+
wpg_select $CurrentDB"select attnum,attname,typname,attlen,attnotnull,atttypmod,usename,usesysid,pg_class.oid,relpages,reltuples,relhaspkey,relhasrules,relacl from pg_class,pg_user,pg_attribute,pg_type where (pg_class.relname='$PgAcVar(tblinfo,tablename)') and (pg_class.oid=pg_attribute.attrelid) and (pg_class.relowner=pg_user.usesysid) and (pg_attribute.atttypid=pg_type.oid) order by attnum" rec {
48
48
set fsize $rec(attlen)
49
49
set fsize1 $rec(atttypmod)
50
50
set ftype $rec(typname)
@@ -68,15 +68,20 @@ global PgAcVar CurrentDB
68
68
set PgAcVar(tblinfo,numtuples) $rec(reltuples)
69
69
set PgAcVar(tblinfo,numpages) $rec(relpages)
70
70
set PgAcVar(tblinfo,permissions) $rec(relacl)
71
+
if {$rec(relhaspkey)=="t"} {
72
+
set PgAcVar(tblinfo,hasprimarykey) [intlmsg Yes]
73
+
} else {
74
+
set PgAcVar(tblinfo,hasprimarykey) [intlmsg No]
75
+
}
71
76
if {$rec(relhasrules)=="t"} {
72
77
set PgAcVar(tblinfo,hasrules) [intlmsg Yes]
73
78
} else {
74
79
set PgAcVar(tblinfo,hasrules) [intlmsg No]
75
80
}
76
81
}
77
82
set PgAcVar(tblinfo,indexlist) {}
78
-
wpg_select $CurrentDB"select pg_index.oid,indexrelid from pg_index, pg_class where (pg_class.relname='$PgAcVar(tblinfo,tablename)') and (pg_class.oid=pg_index.indrelid)" rec {
79
-
lappend PgAcVar(tblinfo,indexlist) $rec(oid)
83
+
wpg_select $CurrentDB"select indexrelid from pg_index, pg_class where (pg_class.relname='$PgAcVar(tblinfo,tablename)') and (pg_class.oid=pg_index.indrelid)" rec {
0 commit comments