summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc G. Fournier1998-03-22 19:35:30 +0000
committerMarc G. Fournier1998-03-22 19:35:30 +0000
commit0279d55eef3385d7f44739f9584afc3c45a8fe33 (patch)
tree3e7722b7d68700255b9f2dbcbf8ea8d5bcb0be54
parent8dd692c8e38e7236a61493f491492ecb85f1adf9 (diff)
Made some changes to clean up how initdb works...just more made a 'PGSQL_OPTS'
variable that can be set in one place to affect everything...
-rw-r--r--src/bin/initdb/initdb.sh40
1 files changed, 19 insertions, 21 deletions
diff --git a/src/bin/initdb/initdb.sh b/src/bin/initdb/initdb.sh
index 7b9e78cdd4c..8c1b81f3a90 100644
--- a/src/bin/initdb/initdb.sh
+++ b/src/bin/initdb/initdb.sh
@@ -26,7 +26,7 @@
#
#
# IDENTIFICATION
-# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.39 1998/03/22 18:28:39 scrappy Exp $
+# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.40 1998/03/22 19:35:30 scrappy Exp $
#
#-------------------------------------------------------------------------
@@ -346,13 +346,14 @@ fi
echo
+PGSQL_OPT="-o /dev/null -F -Q -D$PGDATA"
+
# If the COPY is first, the VACUUM generates an error, so we vacuum first
echo "vacuuming template1"
-echo "vacuum" | postgres -o /dev/null -F -Q -D$PGDATA template1
+echo "vacuum" | postgres $PGSQL_OPT template1 > /dev/null
-echo "COPY pg_shadow TO '$PGDATA/pg_pwd' USING DELIMITERS '\\t'" |\
- postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
- grep -v "'DEBUG:"
+echo "COPY pg_shadow TO '$PGDATA/pg_pwd' USING DELIMITERS '\\t'" | \
+ postgres $PGSQL_OPT template1 > /dev/null
echo "creating public pg_user view"
echo "CREATE TABLE xpg_user ( \
@@ -363,30 +364,27 @@ echo "CREATE TABLE xpg_user ( \
usesuper bool, \
usecatupd bool, \
passwd text, \
- valuntil abstime);" |\
- postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
- grep -v "'DEBUG:"
+ valuntil abstime);" | postgres $PGSQL_OPT template1 > /dev/null
#move it into pg_user
echo "UPDATE pg_class SET relname = 'pg_user' WHERE relname = 'xpg_user';" |\
- postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
- grep -v "'DEBUG:"
+ postgres $PGSQL_OPT template1 > /dev/null
echo "UPDATE pg_type SET typname = 'pg_user' WHERE typname = 'xpg_user';" |\
- postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
- grep -v "'DEBUG:"
+ postgres $PGSQL_OPT template1 > /dev/null
mv $PGDATA/base/template1/xpg_user $PGDATA/base/template1/pg_user
echo "CREATE RULE _RETpg_user AS ON SELECT TO pg_user DO INSTEAD \
SELECT usename, usesysid, usecreatedb, usetrace, \
usesuper, usecatupd, '********'::text as passwd, \
- valuntil FROM pg_shadow;" |\
- postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
- grep -v "'DEBUG:"
-echo "REVOKE ALL on pg_shadow FROM public" |\
- postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null |\
- grep -v "'DEBUG:"
+ valuntil FROM pg_shadow;" | \
+ postgres $PGSQL_OPT template1 > /dev/null
+echo "REVOKE ALL on pg_shadow FROM public" | \
+ postgres $PGSQL_OPT template1 > /dev/null
echo "loading pg_description"
-echo "copy pg_description from '$TEMPLATE_DESCR'" | postgres -F -Q -D$PGDATA template1 > /dev/null
-echo "copy pg_description from '$GLOBAL_DESCR'" | postgres -F -Q -D$PGDATA template1 > /dev/null
-echo "vacuum analyze" | postgres -o /dev/null -F -Q -D$PGDATA template1
+echo "copy pg_description from '$TEMPLATE_DESCR'" | \
+ postgres $PGSQL_OPT template1 > /dev/null
+echo "copy pg_description from '$GLOBAL_DESCR'" | \
+ postgres $PGSQL_OPT template1 > /dev/null
+echo "vacuum analyze" | \
+ postgres $PGSQL_OPT template1 > /dev/null