summaryrefslogtreecommitdiff
path: root/src/bin/scripts
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2002-08-10 16:57:32 +0000
committerPeter Eisentraut <peter_e@gmx.net>2002-08-10 16:57:32 +0000
commit029aa97f2d90a2ef97b2c0ca917bea7268392eb1 (patch)
treeb5a7c08bf2030f7c0b4b1a6cc64ba6e2a809efdb /src/bin/scripts
parent60ac5b805e63ee0055fa9ff44a8486953f6dcbbc (diff)
downloadpostgresql-029aa97f2d90a2ef97b2c0ca917bea7268392eb1.tar.gz
Make sure all clients have the same understanding of default user name
and database. In particular, make script wrappers understand the PGDATABASE environment variable.
Diffstat (limited to 'src/bin/scripts')
-rw-r--r--src/bin/scripts/createdb6
-rw-r--r--src/bin/scripts/createlang.sh6
-rw-r--r--src/bin/scripts/droplang6
-rw-r--r--src/bin/scripts/vacuumdb6
4 files changed, 16 insertions, 8 deletions
diff --git a/src/bin/scripts/createdb b/src/bin/scripts/createdb
index 3087688a3a..639de5476c 100644
--- a/src/bin/scripts/createdb
+++ b/src/bin/scripts/createdb
@@ -12,7 +12,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.23 2002/06/20 20:29:42 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createdb,v 1.24 2002/08/10 16:57:32 petere Exp $
#
#-------------------------------------------------------------------------
@@ -166,7 +166,9 @@ then
fi
if [ -z "$dbname" ]; then
- if [ "$PGUSER" ]; then
+ if [ "$PGDATABASE" ]; then
+ dbname="$PGDATABASE"
+ elif [ "$PGUSER" ]; then
dbname="$PGUSER"
else
dbname=`${PATHNAME}pg_id -u -n`
diff --git a/src/bin/scripts/createlang.sh b/src/bin/scripts/createlang.sh
index daca169a0b..d7a9e98064 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.36 2002/06/20 20:29:42 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/createlang.sh,v 1.37 2002/08/10 16:57:32 petere Exp $
#
#-------------------------------------------------------------------------
@@ -147,7 +147,9 @@ fi
if [ -z "$dbname" ]; then
- if [ "$PGUSER" ]; then
+ if [ "$PGDATABASE" ]; then
+ dbname="$PGDATABASE"
+ elif [ "$PGUSER" ]; then
dbname="$PGUSER"
else
dbname=`${PATHNAME}pg_id -u -n`
diff --git a/src/bin/scripts/droplang b/src/bin/scripts/droplang
index 94bc732894..6970c936b7 100644
--- a/src/bin/scripts/droplang
+++ b/src/bin/scripts/droplang
@@ -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.23 2002/06/20 20:29:42 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/droplang,v 1.24 2002/08/10 16:57:32 petere Exp $
#
#-------------------------------------------------------------------------
@@ -136,7 +136,9 @@ fi
if [ -z "$dbname" ]; then
- if [ "$PGUSER" ]; then
+ if [ "$PGDATABASE" ]; then
+ dbname="$PGDATABASE"
+ elif [ "$PGUSER" ]; then
dbname="$PGUSER"
else
dbname=`${PATHNAME}pg_id -u -n`
diff --git a/src/bin/scripts/vacuumdb b/src/bin/scripts/vacuumdb
index bf4ae4594e..d1c5afc2dd 100644
--- a/src/bin/scripts/vacuumdb
+++ b/src/bin/scripts/vacuumdb
@@ -12,7 +12,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.22 2002/06/20 20:29:42 momjian Exp $
+# $Header: /cvsroot/pgsql/src/bin/scripts/Attic/vacuumdb,v 1.23 2002/08/10 16:57:32 petere Exp $
#
#-------------------------------------------------------------------------
@@ -156,7 +156,9 @@ if [ "$alldb" ]; then
dbname=`${PATHNAME}psql $PSQLOPT -q -t -A -d template1 -c 'SELECT datname FROM pg_database WHERE datallowconn'`
elif [ -z "$dbname" ]; then
- if [ "$PGUSER" ]; then
+ if [ "$PGDATABASE" ]; then
+ dbname="$PGDATABASE"
+ elif [ "$PGUSER" ]; then
dbname="$PGUSER"
else
dbname=`${PATHNAME}pg_id -u -n`