diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-10-21 20:32:33 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-10-21 20:32:33 +0000 |
commit | 2110be0465a8b3f017ccb68a2d1a93bda8d0ce7c (patch) | |
tree | 8796c82a6a1830416e53180f944ec4c0aaf93fd2 /src | |
parent | e49c1a9234cdce95a263801136cbbcb1082531e5 (diff) | |
download | postgresql-2110be0465a8b3f017ccb68a2d1a93bda8d0ce7c.tar.gz postgresql-2110be0465a8b3f017ccb68a2d1a93bda8d0ce7c.zip |
Cleanup for CLUSTERDB failure:
On Sat, Oct 19, 2002 at 12:11:32AM +0200, Peter Eisentraut wrote:
> $ ./clusterdb
> psql: could not connect to server: No such file or directory
> Is the server running locally and accepting
> connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
> psql: could not connect to server: No such file or directory
> Is the server running locally and accepting
> connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
> clusterdb: While clustering peter, the following failed:
> $
>
> This could probably handled a little more gracefully.
Yes, sorry. A patch for this is attached. Please apply.
Alvaro Herrera
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/scripts/clusterdb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bin/scripts/clusterdb b/src/bin/scripts/clusterdb index bc66c319765..ca6510b1906 100644 --- a/src/bin/scripts/clusterdb +++ b/src/bin/scripts/clusterdb @@ -11,7 +11,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/clusterdb,v 1.7 2002/10/18 22:05:36 petere Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/clusterdb,v 1.8 2002/10/21 20:32:33 momjian Exp $ # #------------------------------------------------------------------------- @@ -141,6 +141,7 @@ if [ "$alldb" ]; then exit 1 fi dbname=`${PATHNAME}psql $PSQLOPT -q -t -A -d template1 -c 'SELECT datname FROM pg_database WHERE datallowconn'` + [ "$?" -ne 0 ] && exit 1 elif [ -z "$dbname" ]; then if [ "$PGDATABASE" ]; then @@ -159,6 +160,7 @@ do query="SELECT nspname, pg_class.relname, pg_class_2.relname FROM pg_class, pg_class AS pg_class_2 JOIN pg_namespace ON (pg_namespace.oid=relnamespace), pg_index WHERE pg_class.oid=pg_index.indrelid AND pg_class_2.oid=pg_index.indexrelid AND pg_index.indisclustered AND pg_class.relowner=(SELECT usesysid FROM pg_user WHERE usename=current_user)" if [ -z "$table" ]; then tables=`${PATHNAME}psql $db $PSQLOPT -F: -P format=unaligned -t -c "$query"` + [ "$?" -ne 0 ] && exit 1 else # if tablename has a dot, use it as namespace separator if echo $table | grep -s '\.' 2>&1 >/dev/null |