mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-10-04 00:28:10 +02:00
I attach a patch for pg_upgrade. This does two things:
1. check whether the program is being executed in $PGDATA/.. This is necessary if the data tree is not in the standard place, as is the case with the Debian distribution (because of Debian policy). 2. give a clearer error message if the dumped data structure fails to be loaded. Oliver Elphick
This commit is contained in:
parent
094616ec83
commit
505b2ecdf4
@ -29,8 +29,9 @@ OLDDIR="$1"
|
|||||||
|
|
||||||
# check things
|
# check things
|
||||||
|
|
||||||
if [ ! -f "./lib/global1.bki.source" ]
|
if [ ! -f "./data/PG_VERSION" ]
|
||||||
then echo "$0 must be run from the top of the postgres directory tree." 1>&2
|
then echo "`basename $0` must be run from the directory containing
|
||||||
|
the database directory \`data' (`dirname $PGDATA`.)" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -72,7 +73,8 @@ cat $INPUT | awk ' {
|
|||||||
psql "template1" <"/tmp/$$"
|
psql "template1" <"/tmp/$$"
|
||||||
|
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
then echo "psql failed to execute $INPUT script." 1>&2
|
then echo "There were errors in the input script $INPUT.
|
||||||
|
$0 aborted." 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user