Commit 095d83e1 authored by Bruce Momjian's avatar Bruce Momjian

Cleanup --alldb option handling.

parent d2cf8b47
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
# #
# #
# IDENTIFICATION # 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= ...@@ -22,6 +22,7 @@ verbose=
analyze= analyze=
table= table=
dbname= dbname=
alldb=
while [ $# -gt 0 ] while [ $# -gt 0 ]
do do
...@@ -86,7 +87,7 @@ do ...@@ -86,7 +87,7 @@ do
analyze="ANALYZE " analyze="ANALYZE "
;; ;;
--alldb|-a) --alldb|-a)
dbname="`psql $PASSWDOPT $AUTHOPT $PGHOSTOPT $PGPORTOPT -q -t -A -d template1 -c 'SELECT datname FROM pg_database'`" alldb=Y
;; ;;
--table|-t) --table|-t)
table="$2" table="$2"
...@@ -132,6 +133,10 @@ if [ "$usage" ]; then ...@@ -132,6 +133,10 @@ if [ "$usage" ]; then
exit 1 exit 1
fi 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 if [ -z "$dbname" ]; then
echo "$CMDNAME: Missing required argument database name. Try -? for help." echo "$CMDNAME: Missing required argument database name. Try -? for help."
exit 1 exit 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment