3
3
# pg_upgrade: update a database without needing a full dump/reload cycle.
4
4
# CAUTION: Read the manual page before trying to use this!
5
5
6
- # $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_upgrade,v 1.25 2002/01/11 05:54:59 momjian Exp $
6
+ # $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_upgrade,v 1.26 2002/01/11 06:08:02 momjian Exp $
7
7
#
8
8
# NOTE: we must be sure to update the version-checking code a few dozen lines
9
9
# below for each new PostgreSQL release.
@@ -99,6 +99,7 @@ case "$SRC_VERSION" in
99
99
esac
100
100
101
101
pg_resetxlog 2> /dev/null
102
+ # file not found status is normally 127, not 1
102
103
if [ " $? " -ne 1 ]
103
104
then echo " Unable to find pg_resetxlog in path.
104
105
Install it from pgsql/contrib/pg_resetxlog and continue.; exiting" 1>&2
@@ -241,13 +242,15 @@ done
241
242
242
243
243
244
# Set this so the next VACUUM sets the old row XID's as "frozen"
245
+ # Commit status already updated by vacuum above
246
+
244
247
pg_resetxlog -x " $XID " data
245
248
if [ " $? " -ne 0 ]
246
249
then echo " Unable to set new XID.; exiting" 1>&2
247
250
exit 1
248
251
fi
249
252
250
- # set last checkpoint location from old database
253
+ # Set last checkpoint location from old database
251
254
252
255
CHKPOINT=` pg_resetxlog -n " $OLDDIR " | grep " checkpoint location:" |
253
256
awk -F' *' ' {print $4}' `
@@ -256,6 +259,8 @@ then echo "Unable to get old checkpoint location.; exiting" 1>&2
256
259
exit 1
257
260
fi
258
261
262
+ # Set checkpoint location of new database
263
+
259
264
pg_resetxlog -l ` echo " $CHKPOINT | tr '/' ' '` data
260
265
if [ " $? " -ne 0 ]
261
266
then echo " Unable to set new checkpoint location.; exiting" 1>&2
@@ -271,6 +276,7 @@ then echo "Unable to restart database server.; exiting" 1>&2
271
276
fi
272
277
273
278
# Set sequence values for 7.1-version sequences, which were int4.
279
+
274
280
if [ " $SRC_VERSION " = " 7.1" ]
275
281
else echo " Set int8 sequence values from 7.1..."
276
282
0 commit comments