Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 953002f

Browse files
committed
Properly compute max sys oid for 7.0 and 7.1.
1 parent 4d84b7a commit 953002f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

src/bin/pgaccess/lib/mainlib.tcl

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,18 @@ global CurrentDB
105105

106106

107107
proc {cmd_Functions} {} {
108-
global CurrentDB
108+
global PgAcVar CurrentDB
109109
set maxim 16384
110110
setCursor CLOCK
111-
catch {
112-
wpg_select $CurrentDB "select oid from pg_database where datname='template1'" rec {
113-
set maxim $rec(oid)
111+
set dbname $PgAcVar(opendb,dbname)
112+
if [catch {wpg_select $CurrentDB "select datlastsysoid from pg_database where datname='$dbname'" rec {
113+
set maxim $rec(datlastsysoid)
114+
}
115+
}] {
116+
catch {
117+
wpg_select $CurrentDB "select oid from pg_database where datname='template1'" rec {
118+
set maxim $rec(oid)
119+
}
114120
}
115121
}
116122
.pgaw:Main.lb delete 0 end

0 commit comments

Comments
 (0)