From 0279d55eef3385d7f44739f9584afc3c45a8fe33 Mon Sep 17 00:00:00 2001 From: "Marc G. Fournier" Date: Sun, 22 Mar 1998 19:35:30 +0000 Subject: [PATCH] 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... --- src/bin/initdb/initdb.sh | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/src/bin/initdb/initdb.sh b/src/bin/initdb/initdb.sh index 7b9e78cdd4..8c1b81f3a9 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