aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1996-07-25 06:55:49 +0000
committerMarc G. Fournier <scrappy@hub.org>1996-07-25 06:55:49 +0000
commitff50e5ab475f5ca5a86d6dd0f13bc088bed4fdc3 (patch)
tree40e148aee1a73fc3dd1188f01a395c9dc3774793 /src
parent69ee15d66351bcbe0e4447b1804ed20d01a5f885 (diff)
downloadpostgresql-ff50e5ab475f5ca5a86d6dd0f13bc088bed4fdc3.tar.gz
postgresql-ff50e5ab475f5ca5a86d6dd0f13bc088bed4fdc3.zip
Switched from using monitor to using psql
Submitted by: Rick Weldon <rick@wisetech.com>
Diffstat (limited to 'src')
-rw-r--r--src/bin/createdb/createdb.sh4
-rw-r--r--src/bin/createuser/createuser.sh14
-rw-r--r--src/bin/destroydb/destroydb.sh4
-rw-r--r--src/bin/destroyuser/destroyuser.sh17
4 files changed, 20 insertions, 19 deletions
diff --git a/src/bin/createdb/createdb.sh b/src/bin/createdb/createdb.sh
index 2d2116d4699..0baab04634b 100644
--- a/src/bin/createdb/createdb.sh
+++ b/src/bin/createdb/createdb.sh
@@ -11,7 +11,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/createdb/Attic/createdb.sh,v 1.1.1.1 1996/07/09 06:22:12 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/bin/createdb/Attic/createdb.sh,v 1.2 1996/07/25 06:55:23 scrappy Exp $
#
#-------------------------------------------------------------------------
@@ -58,7 +58,7 @@ done
AUTHOPT="-a $AUTHSYS"
[ -z "$AUTHSYS" ] && AUTHOPT=""
-monitor -TN $AUTHOPT -h $PGHOST -p $PGPORT -c "create database $dbname" template1 || {
+psql -Tq $AUTHOPT -H $PGHOST -p $PGPORT -c "create database $dbname" template1 || {
echo "$CMDNAME: database creation failed on $dbname."
exit 1
}
diff --git a/src/bin/createuser/createuser.sh b/src/bin/createuser/createuser.sh
index 4178f945961..942fccfbc62 100644
--- a/src/bin/createuser/createuser.sh
+++ b/src/bin/createuser/createuser.sh
@@ -8,7 +8,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.1.1.1 1996/07/09 06:22:12 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/bin/createuser/Attic/createuser.sh,v 1.2 1996/07/25 06:55:30 scrappy Exp $
#
# Note - this should NOT be setuid.
#
@@ -55,13 +55,13 @@ done
AUTHOPT="-a $AUTHSYS"
[ -z "$AUTHSYS" ] && AUTHOPT=""
-MARGS="-TN $AUTHOPT -h $PGHOST -p $PGPORT"
+PARGS="-T -q $AUTHOPT -H $PGHOST -p $PGPORT"
#
# generate the first part of the actual monitor command
#
-MONITOR="monitor $MARGS"
+PSQL="psql $PARGS"
#
# see if user $USER is allowed to create new users
@@ -70,7 +70,7 @@ MONITOR="monitor $MARGS"
QUERY="select usesuper from pg_user where usename = '$USER'"
#echo $QUERY
-ADDUSER=`$MONITOR -TN -c "$QUERY" template1`
+ADDUSER=`$PSQL -c "$QUERY" template1`
if [ $? -ne 0 ]
then
@@ -100,7 +100,7 @@ fi
QUERY="select usesysid from pg_user where usename = '$NEWUSER'"
-RES=`$MONITOR -TN -c "$QUERY" template1`
+RES=`$PSQL -c "$QUERY" template1`
if [ $? -ne 0 ]
then
@@ -142,7 +142,7 @@ do
exit 1
fi
QUERY="select usename from pg_user where usesysid = '$SYSID'::int4"
- RES=`$MONITOR -TN -c "$QUERY" template1`
+ RES=`$PSQL -c "$QUERY" template1`
if [ $? -ne 0 ]
then
echo "$CMDNAME: database access failed."
@@ -206,7 +206,7 @@ QUERY="insert into pg_user \
values \
('$NEWUSER', $SYSID, '$CANCREATE', 't', '$CANADDUSER','t')"
-RES=`$MONITOR -TN -c "$QUERY" template1`
+RES=`$PSQL -c "$QUERY" template1`
#
# Wrap things up. If the user was created successfully, AND the user was
diff --git a/src/bin/destroydb/destroydb.sh b/src/bin/destroydb/destroydb.sh
index 564d503a1d3..79b24a957cf 100644
--- a/src/bin/destroydb/destroydb.sh
+++ b/src/bin/destroydb/destroydb.sh
@@ -11,7 +11,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/destroydb/Attic/destroydb.sh,v 1.1.1.1 1996/07/09 06:22:12 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/bin/destroydb/Attic/destroydb.sh,v 1.2 1996/07/25 06:55:41 scrappy Exp $
#
#-------------------------------------------------------------------------
@@ -58,7 +58,7 @@ done
AUTHOPT="-a $AUTHSYS"
[ -z "$AUTHSYS" ] && AUTHOPT=""
-monitor -TN -h $PGHOST -p $PGPORT -c "drop database $dbname" template1
+psql -Tq -H $PGHOST -p $PGPORT -c "drop database $dbname" template1
if [ $? -ne 0 ]
then
diff --git a/src/bin/destroyuser/destroyuser.sh b/src/bin/destroyuser/destroyuser.sh
index e600748f14f..cb257ef4485 100644
--- a/src/bin/destroyuser/destroyuser.sh
+++ b/src/bin/destroyuser/destroyuser.sh
@@ -8,7 +8,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/destroyuser.sh,v 1.1.1.1 1996/07/09 06:22:12 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/bin/destroyuser/Attic/destroyuser.sh,v 1.2 1996/07/25 06:55:49 scrappy Exp $
#
# Note - this should NOT be setuid.
#
@@ -55,12 +55,13 @@ done
AUTHOPT="-a $AUTHSYS"
[ -z "$AUTHSYS" ] && AUTHOPT=""
-MARGS="-TN $AUTHOPT -p $PGPORT -h $PGHOST"
+PARGS="-Tq $AUTHOPT -p $PGPORT -H $PGHOST"
#
# generate the first part of the actual monitor command
#
-MONITOR="monitor $MARGS"
+PSQL="psql $PARGS"
+
#
# see if user $USER is allowed to create new users. Only a user who can
@@ -68,7 +69,7 @@ MONITOR="monitor $MARGS"
#
QUERY="select usesuper from pg_user where usename = '$USER'"
-ADDUSER=`$MONITOR -c "$QUERY" template1`
+ADDUSER=`$PSQL -c "$QUERY" template1`
if [ $? -ne 0 ]
then
@@ -93,7 +94,7 @@ fi
QUERY="select usesysid from pg_user where usename = '$DELUSER'"
-RES=`$MONITOR -c "$QUERY" template1`
+RES=`$PSQL -c "$QUERY" template1`
if [ $? -ne 0 ]
then
@@ -117,7 +118,7 @@ SYSID=`echo $RES | sed 's/ //g'`
QUERY="select datname from pg_database where datdba = '$SYSID'::oid"
-ALLDBS=`$MONITOR -c "$QUERY" template1`
+ALLDBS=`$PSQL -c "$QUERY" template1`
if [ $? -ne 0 ]
then
@@ -170,7 +171,7 @@ then
echo "destroying database $i"
QUERY="drop database $i"
- $MONITOR -c "$QUERY" template1
+ $PSQL -c "$QUERY" template1
if [ $? -ne 0 ]
then
echo "$CMDNAME: drop database on $i failed - exiting"
@@ -181,7 +182,7 @@ fi
QUERY="delete from pg_user where usename = '$DELUSER'"
-$MONITOR -c "$QUERY" template1
+$PSQL -c "$QUERY" template1
if [ $? -ne 0 ]
then
echo "$CMDNAME: delete of user $DELUSER was UNSUCCESSFUL"