diff options
author | Bruce Momjian | 2002-10-16 03:24:09 +0000 |
---|---|---|
committer | Bruce Momjian | 2002-10-16 03:24:09 +0000 |
commit | 5d8c67462d93b33b13fe5e45b26002b8e625002c (patch) | |
tree | 5aafb80d4146a135c7cbebc951198b0c48a64e5e /src/bin/scripts/createuser | |
parent | facb72007333d9c0acff0f8d64b36d2c4a262665 (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/createuser')
-rw-r--r-- | src/bin/scripts/createuser | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/scripts/createuser b/src/bin/scripts/createuser index 04bbe135e59..83b48e5599a 100644 --- a/src/bin/scripts/createuser +++ b/src/bin/scripts/createuser @@ -9,7 +9,7 @@ # # # IDENTIFICATION -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.26 2002/06/20 20:29:42 momjian Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.27 2002/10/16 03:24:09 momjian Exp $ # # Note - this should NOT be setuid. # @@ -253,7 +253,7 @@ SUBQUERY= [ "$CanAddUser" = t ] && QUERY="$QUERY CREATEUSER" [ "$CanAddUser" = f ] && QUERY="$QUERY NOCREATEUSER" -${PATHNAME}psql -c "$QUERY" -d template1 $PSQLOPT +${PATHNAME}psql -c "SET autocommit = 'on';$QUERY" -d template1 $PSQLOPT if [ "$?" -ne 0 ]; then echo "$CMDNAME: creation of user \"$NewUser\" failed" 1>&2 exit 1 |