55
66# set -x
77
8- # $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_upgrade,v 1.27 2002/01/11 06:33:01 momjian Exp $
8+ # $Header: /cvsroot/pgsql/src/bin/pg_dump/Attic/pg_upgrade,v 1.28 2002/01/11 06:48:41 momjian Exp $
99#
1010# NOTE: we must be sure to update the version-checking code a few dozen lines
1111# below for each new PostgreSQL release.
158158# we are done with SQL database access
159159# shutdown forces buffers to disk
160160
161- pg_ctl stop
161+ pg_ctl-w stop
162162if [" $? " -ne 0 ]
163163then echo " Unable to stop database server.; exiting" 1>&2
164164exit 1
271271
272272# Restart server with moved data
273273
274- pg_ctl start
274+ pg_ctl-w start
275275if [" $? " -ne 0 ]
276276then echo " Unable to restart database server.; exiting" 1>&2
277277exit 1
@@ -283,11 +283,14 @@ if [ "$SRC_VERSION" = "7.1" ]
283283then echo " Set int8 sequence values from 7.1..."
284284
285285psql -d template1 -At -c" SELECT datname FROM pg_database" |
286+ grep -v' ^template0$' | # no system databases
287+ grep -v' ^template1$' | # no system databases
286288while read DB
287289do
288290echo " $DB "
289291# XXX is concurrency a problem here?
290292psql -d" $DB " -At -c" SELECT relname FROM pg_class where relkind = 'S';" |
293+ grep -v' ^pg_' | # no system tables
291294while read SEQUENCE
292295do
293296psql -d" $DB " -At<< SQL_END