From 5d8c67462d93b33b13fe5e45b26002b8e625002c Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Wed, 16 Oct 2002 03:24:09 +0000 Subject: Fix script to handle autocommit = 'off' by prepending autocommit 'on' to the start of the psql commandline. This is better than adding BEGIN/END because it handles multiple queries well, and allows the return code for psql to return the proper value. --- src/bin/scripts/dropdb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bin/scripts/dropdb') diff --git a/src/bin/scripts/dropdb b/src/bin/scripts/dropdb index 8c3d9cbb090..9ad1b40ebab 100644 --- a/src/bin/scripts/dropdb +++ b/src/bin/scripts/dropdb @@ -11,7 +11,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.16 2002/06/20 20:29:42 momjian Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.17 2002/10/16 03:24:09 momjian Exp $ # #------------------------------------------------------------------------- @@ -138,7 +138,7 @@ fi dbname=`echo "$dbname" | sed 's/\"/\\\"/g'` -${PATHNAME}psql $PSQLOPT -d template1 -c "DROP DATABASE \"$dbname\"" +${PATHNAME}psql $PSQLOPT -d template1 -c "SET autocommit = 'on';DROP DATABASE \"$dbname\"" if [ "$?" -ne 0 ]; then echo "$CMDNAME: database removal failed" 1>&2 exit 1 -- cgit v1.2.3