mirror of
https://github.com/postgres/postgres.git
synced 2025-11-01 21:31:19 +03:00
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.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.18 2002/06/20 20:29:42 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.19 2002/10/16 03:24:09 momjian Exp $
|
||||
#
|
||||
# Note - this should NOT be setuid.
|
||||
#
|
||||
@@ -148,7 +148,7 @@ fi
|
||||
|
||||
DelUser=`echo "$DelUser" | sed 's/\"/\\\"/g'`
|
||||
|
||||
${PATHNAME}psql $PSQLOPT -d template1 -c "DROP USER \"$DelUser\""
|
||||
${PATHNAME}psql $PSQLOPT -d template1 -c "SET autocommit = 'on';DROP USER \"$DelUser\""
|
||||
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "$CMDNAME: deletion of user \"$DelUser\" failed" 1>&2
|
||||
|
||||
Reference in New Issue
Block a user