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/clusterdb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bin/scripts/clusterdb') 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 -- cgit v1.2.3