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 {
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 {
set fsize $rec(attlen)
set fsize1 $rec(atttypmod)
set ftype $rec(typname)
...
...
@@ -68,6 +68,11 @@ global PgAcVar CurrentDB
set PgAcVar(tblinfo,numtuples) $rec(reltuples)
set PgAcVar(tblinfo,numpages) $rec(relpages)
set PgAcVar(tblinfo,permissions) $rec(relacl)
if {$rec(relhaspkey)=="t"}{
set PgAcVar(tblinfo,hasprimarykey)[intlmsg Yes]
} else {
set PgAcVar(tblinfo,hasprimarykey)[intlmsg No]
}
if {$rec(relhasrules)=="t"}{
set PgAcVar(tblinfo,hasrules)[intlmsg Yes]
} else {
...
...
@@ -75,8 +80,8 @@ global PgAcVar CurrentDB
}
}
set PgAcVar(tblinfo,indexlist){}
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 {
lappend PgAcVar(tblinfo,indexlist) $rec(oid)
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 {