]> granicus.if.org Git - postgresql/commitdiff
check for failure after vacuuming each DB, not only the last one.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 8 Jan 2001 20:32:27 +0000 (20:32 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 8 Jan 2001 20:32:27 +0000 (20:32 +0000)
src/bin/scripts/vacuumdb

index 9b310327a1f2f61f1265698ef8b04be0373cc597..3bd005445a8457c1c3a94441f665875a3e95d0db 100644 (file)
@@ -11,7 +11,7 @@
 #
 #
 # IDENTIFICATION
-#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.13 2000/11/25 19:05:44 petere Exp $
+#    $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.14 2001/01/08 20:32:27 tgl Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -145,7 +145,7 @@ if [ "$alldb" ]; then
        dbname=`${PATHNAME}psql $PSQLOPT -q -t -A -d template1 -c 'SELECT datname FROM pg_database'`
 
 elif [ -z "$dbname" ]; then
-       echo "$CMDNAME: missing required argument database name" 1>&2
+       echo "$CMDNAME: missing required argument: database name" 1>&2
         echo "Try '$CMDNAME -?' for help." 1>&2
        exit 1
 fi
@@ -154,11 +154,10 @@ for db in $dbname
 do
         [ "$alldb" -a "$quiet" -ne 1 ] && echo "Vacuuming $db"
        ${PATHNAME}psql $PSQLOPT $ECHOOPT -c "VACUUM $verbose $analyze $table" -d $db
+       if [ $? -ne 0 ]; then
+           echo "$CMDNAME: vacuum $table $db failed" 1>&2
+           exit 1
+       fi
 done
 
-if [ $? -ne 0 ]; then
-       echo "$CMDNAME: vacuum failed" 1>&2
-       exit 1
-fi
-
 exit 0