diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-10-16 03:24:09 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-10-16 03:24:09 +0000 |
commit | 5d8c67462d93b33b13fe5e45b26002b8e625002c (patch) | |
tree | 5aafb80d4146a135c7cbebc951198b0c48a64e5e /src/bin/scripts/createlang.sh | |
parent | facb72007333d9c0acff0f8d64b36d2c4a262665 (diff) | |
download | postgresql-5d8c67462d93b33b13fe5e45b26002b8e625002c.tar.gz postgresql-5d8c67462d93b33b13fe5e45b26002b8e625002c.zip |
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/createlang.sh')
-rw-r--r-- | src/bin/scripts/createlang.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/bin/scripts/createlang.sh b/src/bin/scripts/createlang.sh index b84680aab79..0c408553c68 100644 --- a/src/bin/scripts/createlang.sh +++ b/src/bin/scripts/createlang.sh @@ -7,7 +7,7 @@ # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group # Portions Copyright (c) 1994, Regents of the University of California # -# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.39 2002/09/24 23:14:25 tgl Exp $ +# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.40 2002/10/16 03:24:09 momjian Exp $ # #------------------------------------------------------------------------- @@ -270,7 +270,7 @@ fi # Create the call handler and the language # ---------- if [ "$handlerexists" = no ]; then - sqlcmd="CREATE FUNCTION \"$handler\" () RETURNS LANGUAGE_HANDLER AS '$PGLIB/${object}' LANGUAGE C;" + sqlcmd="SET autocommit = 'on';CREATE FUNCTION \"$handler\" () RETURNS LANGUAGE_HANDLER AS '$PGLIB/${object}' LANGUAGE C;" if [ "$showsql" = yes ]; then echo "$sqlcmd" fi @@ -281,7 +281,7 @@ if [ "$handlerexists" = no ]; then fi fi -sqlcmd="CREATE ${trusted}LANGUAGE \"$langname\" HANDLER \"$handler\";" +sqlcmd="SET autocommit = 'on';CREATE ${trusted}LANGUAGE \"$langname\" HANDLER \"$handler\";" if [ "$showsql" = yes ]; then echo "$sqlcmd" fi @@ -297,7 +297,7 @@ fi # seems best to disable public USAGE for an untrusted one. # ---------- if test -z "$trusted"; then - sqlcmd="REVOKE ALL ON LANGUAGE \"$langname\" FROM PUBLIC;" + sqlcmd="SET autocommit = 'on';REVOKE ALL ON LANGUAGE \"$langname\" FROM PUBLIC;" if [ "$showsql" = yes ]; then echo "$sqlcmd" fi |