From 095d83e1294ab54f1a2784b4b9e82d8f2281e4dd Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Sat, 18 Dec 1999 08:46:44 +0000 Subject: [PATCH] Cleanup --alldb option handling. --- src/bin/scripts/vacuumdb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bin/scripts/vacuumdb b/src/bin/scripts/vacuumdb index 3261416df4..234a26b2ca 100644 --- a/src/bin/scripts/vacuumdb +++ b/src/bin/scripts/vacuumdb @@ -11,7 +11,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.6 1999/12/18 08:39:12 momjian Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.7 1999/12/18 08:46:44 momjian Exp $ # #------------------------------------------------------------------------- @@ -22,6 +22,7 @@ verbose= analyze= table= dbname= +alldb= while [ $# -gt 0 ] do @@ -86,7 +87,7 @@ do analyze="ANALYZE " ;; --alldb|-a) - dbname="`psql $PASSWDOPT $AUTHOPT $PGHOSTOPT $PGPORTOPT -q -t -A -d template1 -c 'SELECT datname FROM pg_database'`" + alldb=Y ;; --table|-t) table="$2" @@ -132,6 +133,10 @@ if [ "$usage" ]; then exit 1 fi +if [ ! -z "$alldb" ]; then + dbname="`psql $PASSWDOPT $AUTHOPT $PGHOSTOPT $PGPORTOPT -q -t -A -d template1 -c 'SELECT datname FROM pg_database'`" +fi + if [ -z "$dbname" ]; then echo "$CMDNAME: Missing required argument database name. Try -? for help." exit 1 -- 2.40.0