aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2001-05-30 18:08:24 +0000
committerBruce Momjian <bruce@momjian.us>2001-05-30 18:08:24 +0000
commit953002f1b37ae05b0bd0874b63835dd23a8adf2e (patch)
treeac912268259aa3c557bcf8e94b7b45963a728607 /src
parent4d84b7a10f9f78dcedaf9fc495d23a54da38458d (diff)
downloadpostgresql-953002f1b37ae05b0bd0874b63835dd23a8adf2e.tar.gz
postgresql-953002f1b37ae05b0bd0874b63835dd23a8adf2e.zip
Properly compute max sys oid for 7.0 and 7.1.
Diffstat (limited to 'src')
-rw-r--r--src/bin/pgaccess/lib/mainlib.tcl14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/bin/pgaccess/lib/mainlib.tcl b/src/bin/pgaccess/lib/mainlib.tcl
index 15675b29c34..781989cc7b4 100644
--- a/src/bin/pgaccess/lib/mainlib.tcl
+++ b/src/bin/pgaccess/lib/mainlib.tcl
@@ -105,12 +105,18 @@ global CurrentDB
proc {cmd_Functions} {} {
-global CurrentDB
+global PgAcVar CurrentDB
set maxim 16384
setCursor CLOCK
- catch {
- wpg_select $CurrentDB "select oid from pg_database where datname='template1'" rec {
- set maxim $rec(oid)
+ set dbname $PgAcVar(opendb,dbname)
+ if [catch {wpg_select $CurrentDB "select datlastsysoid from pg_database where datname='$dbname'" rec {
+ set maxim $rec(datlastsysoid)
+ }
+ }] {
+ catch {
+ wpg_select $CurrentDB "select oid from pg_database where datname='template1'" rec {
+ set maxim $rec(oid)
+ }
}
}
.pgaw:Main.lb delete 0 end