Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian2002-10-16 03:24:09 +0000
committerBruce Momjian2002-10-16 03:24:09 +0000
commit5d8c67462d93b33b13fe5e45b26002b8e625002c (patch)
tree5aafb80d4146a135c7cbebc951198b0c48a64e5e /src/bin/scripts/dropdb
parentfacb72007333d9c0acff0f8d64b36d2c4a262665 (diff)
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.
Diffstat (limited to 'src/bin/scripts/dropdb')
-rw-r--r--src/bin/scripts/dropdb4
1 files changed, 2 insertions, 2 deletions
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