diff options
author | Bruce Momjian <bruce@momjian.us> | 1999-06-07 22:58:31 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1999-06-07 22:58:31 +0000 |
commit | 505b2ecdf4bcc990bb352fe7619283c0f334a295 (patch) | |
tree | 0614a4c6410451fcbcfd87d8989861b9bb0297d4 /src | |
parent | 094616ec83cf04d7df5cbe7266a62dcafbcfbf3a (diff) | |
download | postgresql-505b2ecdf4bcc990bb352fe7619283c0f334a295.tar.gz postgresql-505b2ecdf4bcc990bb352fe7619283c0f334a295.zip |
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
Diffstat (limited to 'src')
-rwxr-xr-x | src/bin/pg_dump/pg_upgrade | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bin/pg_dump/pg_upgrade b/src/bin/pg_dump/pg_upgrade index 22eff823256..e566a912ba6 100755 --- a/src/bin/pg_dump/pg_upgrade +++ b/src/bin/pg_dump/pg_upgrade @@ -29,8 +29,9 @@ OLDDIR="$1" # check things -if [ ! -f "./lib/global1.bki.source" ] -then echo "$0 must be run from the top of the postgres directory tree." 1>&2 +if [ ! -f "./data/PG_VERSION" ] +then echo "`basename $0` must be run from the directory containing +the database directory \`data' (`dirname $PGDATA`.)" 1>&2 exit 1 fi @@ -72,7 +73,8 @@ cat $INPUT | awk ' { psql "template1" <"/tmp/$$" 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 fi |