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/clusterdb
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/clusterdb')
-rw-r--r--src/bin/scripts/clusterdb4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/scripts/clusterdb b/src/bin/scripts/clusterdb
index d948dc52069..c2b8b4e143c 100644
--- a/src/bin/scripts/clusterdb
+++ b/src/bin/scripts/clusterdb
@@ -11,7 +11,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/clusterdb,v 1.4 2002/09/27 17:51:10 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/clusterdb,v 1.5 2002/10/16 03:24:09 momjian Exp $
#
#-------------------------------------------------------------------------
@@ -176,7 +176,7 @@ do
idx=`echo $tabs | cut -d: -f3`
query="$query CLUSTER $idx ON $nspc.$tab;"
done
- ${PATHNAME}psql $PSQLOPT $ECHOOPT -c "$query" -d $db
+ ${PATHNAME}psql $PSQLOPT $ECHOOPT -c "SET autocommit = 'on';$query" -d $db
if [ "$?" -ne 0 ]
then
echo "$CMDNAME: While clustering $db, the following failed: $query" 1>&2