mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-06 15:24:56 +08:00
Improve appearance of SET command.
This commit is contained in:
parent
5d8c67462d
commit
6b0e166644
@ -11,7 +11,7 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/clusterdb,v 1.5 2002/10/16 03:24:09 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/clusterdb,v 1.6 2002/10/16 03:44:28 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 "SET autocommit = 'on';$query" -d $db
|
||||
${PATHNAME}psql $PSQLOPT $ECHOOPT -c "SET autocommit TO 'on';$query" -d $db
|
||||
if [ "$?" -ne 0 ]
|
||||
then
|
||||
echo "$CMDNAME: While clustering $db, the following failed: $query" 1>&2
|
||||
|
@ -12,7 +12,7 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.26 2002/10/16 03:24:09 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.27 2002/10/16 03:44:28 momjian Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -189,7 +189,7 @@ withstring=
|
||||
[ "$TEMPLATE" ] && withstring="$withstring TEMPLATE = \"$TEMPLATE\""
|
||||
[ "$withstring" ] && withstring=" WITH$withstring"
|
||||
|
||||
${PATHNAME}psql $PSQLOPT -d template1 -c "SET autocommit = 'on';CREATE DATABASE \"$dbname\"$withstring"
|
||||
${PATHNAME}psql $PSQLOPT -d template1 -c "SET autocommit TO 'on';CREATE DATABASE \"$dbname\"$withstring"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "$CMDNAME: database creation failed" 1>&2
|
||||
exit 1
|
||||
@ -200,7 +200,7 @@ fi
|
||||
|
||||
dbcomment=`echo "$dbcomment" | sed "s/'/\\\\\'/g"`
|
||||
|
||||
${PATHNAME}psql $PSQLOPT -d "$dbname" -c "SET autocommit = 'on';COMMENT ON DATABASE \"$dbname\" IS '$dbcomment'"
|
||||
${PATHNAME}psql $PSQLOPT -d "$dbname" -c "SET autocommit TO 'on';COMMENT ON DATABASE \"$dbname\" IS '$dbcomment'"
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "$CMDNAME: comment creation failed (database was created)" 1>&2
|
||||
exit 1
|
||||
|
@ -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.40 2002/10/16 03:24:09 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.41 2002/10/16 03:44:28 momjian Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -270,7 +270,7 @@ fi
|
||||
# Create the call handler and the language
|
||||
# ----------
|
||||
if [ "$handlerexists" = no ]; then
|
||||
sqlcmd="SET autocommit = 'on';CREATE FUNCTION \"$handler\" () RETURNS LANGUAGE_HANDLER AS '$PGLIB/${object}' LANGUAGE C;"
|
||||
sqlcmd="SET autocommit TO '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="SET autocommit = 'on';CREATE ${trusted}LANGUAGE \"$langname\" HANDLER \"$handler\";"
|
||||
sqlcmd="SET autocommit TO '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="SET autocommit = 'on';REVOKE ALL ON LANGUAGE \"$langname\" FROM PUBLIC;"
|
||||
sqlcmd="SET autocommit TO 'on';REVOKE ALL ON LANGUAGE \"$langname\" FROM PUBLIC;"
|
||||
if [ "$showsql" = yes ]; then
|
||||
echo "$sqlcmd"
|
||||
fi
|
||||
|
@ -9,7 +9,7 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.27 2002/10/16 03:24:09 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createuser,v 1.28 2002/10/16 03:44:28 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 "SET autocommit = 'on';$QUERY" -d template1 $PSQLOPT
|
||||
${PATHNAME}psql -c "SET autocommit TO 'on';$QUERY" -d template1 $PSQLOPT
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "$CMDNAME: creation of user \"$NewUser\" failed" 1>&2
|
||||
exit 1
|
||||
|
@ -11,7 +11,7 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.17 2002/10/16 03:24:09 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropdb,v 1.18 2002/10/16 03:44:28 momjian Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -138,7 +138,7 @@ fi
|
||||
|
||||
dbname=`echo "$dbname" | sed 's/\"/\\\"/g'`
|
||||
|
||||
${PATHNAME}psql $PSQLOPT -d template1 -c "SET autocommit = 'on';DROP DATABASE \"$dbname\""
|
||||
${PATHNAME}psql $PSQLOPT -d template1 -c "SET autocommit TO 'on';DROP DATABASE \"$dbname\""
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "$CMDNAME: database removal failed" 1>&2
|
||||
exit 1
|
||||
|
@ -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/droplang,v 1.25 2002/10/16 03:24:09 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.26 2002/10/16 03:44:28 momjian Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -229,7 +229,7 @@ fi
|
||||
# ----------
|
||||
# Drop the language
|
||||
# ----------
|
||||
sqlcmd="SET autocommit = 'on';DROP LANGUAGE \"$langname\";"
|
||||
sqlcmd="SET autocommit TO 'on';DROP LANGUAGE \"$langname\";"
|
||||
if [ "$showsql" = yes ]; then
|
||||
echo "$sqlcmd"
|
||||
fi
|
||||
@ -256,7 +256,7 @@ if [ "$?" -ne 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sqlcmd="SET autocommit = 'on';DROP FUNCTION \"$handler\" ();"
|
||||
sqlcmd="SET autocommit TO 'on';DROP FUNCTION \"$handler\" ();"
|
||||
if [ "$showsql" = yes ]; then
|
||||
echo "$sqlcmd"
|
||||
fi
|
||||
|
@ -9,7 +9,7 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.19 2002/10/16 03:24:09 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/dropuser,v 1.20 2002/10/16 03:44:28 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 "SET autocommit = 'on';DROP USER \"$DelUser\""
|
||||
${PATHNAME}psql $PSQLOPT -d template1 -c "SET autocommit TO 'on';DROP USER \"$DelUser\""
|
||||
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "$CMDNAME: deletion of user \"$DelUser\" failed" 1>&2
|
||||
|
@ -12,7 +12,7 @@
|
||||
#
|
||||
#
|
||||
# IDENTIFICATION
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.24 2002/10/16 03:24:09 momjian Exp $
|
||||
# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.25 2002/10/16 03:44:28 momjian Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -169,7 +169,7 @@ fi
|
||||
for db in $dbname
|
||||
do
|
||||
[ "$alldb" -a "$quiet" -ne 1 ] && echo "Vacuuming $db"
|
||||
${PATHNAME}psql $PSQLOPT $ECHOOPT -c "SET autocommit = 'on';VACUUM $full $verbose $analyze $table" -d $db
|
||||
${PATHNAME}psql $PSQLOPT $ECHOOPT -c "SET autocommit TO 'on';VACUUM $full $verbose $analyze $table" -d $db
|
||||
if [ "$?" -ne 0 ]; then
|
||||
echo "$CMDNAME: vacuum $table $db failed" 1>&2
|
||||
exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user