26
26
#
27
27
#
28
28
# IDENTIFICATION
29
- # $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.39 1998/03/22 18:28:39 scrappy Exp $
29
+ # $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.40 1998/03/22 19:35:30 scrappy Exp $
30
30
#
31
31
# -------------------------------------------------------------------------
32
32
346
346
347
347
echo
348
348
349
+ PGSQL_OPT=" -o /dev/null -F -Q -D$PGDATA "
350
+
349
351
# If the COPY is first, the VACUUM generates an error, so we vacuum first
350
352
echo " vacuuming template1"
351
- echo " vacuum" | postgres -o /dev/null -F -Q -D $PGDATA template1
353
+ echo " vacuum" | postgres $PGSQL_OPT template1 > /dev/null
352
354
353
- echo " COPY pg_shadow TO '$PGDATA /pg_pwd' USING DELIMITERS '\\ t'" | \
354
- postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null | \
355
- grep -v " 'DEBUG:"
355
+ echo " COPY pg_shadow TO '$PGDATA /pg_pwd' USING DELIMITERS '\\ t'" | \
356
+ postgres $PGSQL_OPT template1 > /dev/null
356
357
357
358
echo " creating public pg_user view"
358
359
echo " CREATE TABLE xpg_user ( \
@@ -363,30 +364,27 @@ echo "CREATE TABLE xpg_user ( \
363
364
usesuper bool, \
364
365
usecatupd bool, \
365
366
passwd text, \
366
- valuntil abstime);" | \
367
- postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null | \
368
- grep -v " 'DEBUG:"
367
+ valuntil abstime);" | postgres $PGSQL_OPT template1 > /dev/null
369
368
370
369
# move it into pg_user
371
370
echo " UPDATE pg_class SET relname = 'pg_user' WHERE relname = 'xpg_user';" | \
372
- postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null | \
373
- grep -v " 'DEBUG:"
371
+ postgres $PGSQL_OPT template1 > /dev/null
374
372
echo " UPDATE pg_type SET typname = 'pg_user' WHERE typname = 'xpg_user';" | \
375
- postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null | \
376
- grep -v " 'DEBUG:"
373
+ postgres $PGSQL_OPT template1 > /dev/null
377
374
mv $PGDATA /base/template1/xpg_user $PGDATA /base/template1/pg_user
378
375
379
376
echo " CREATE RULE _RETpg_user AS ON SELECT TO pg_user DO INSTEAD \
380
377
SELECT usename, usesysid, usecreatedb, usetrace, \
381
378
usesuper, usecatupd, '********'::text as passwd, \
382
- valuntil FROM pg_shadow;" | \
383
- postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null | \
384
- grep -v " 'DEBUG:"
385
- echo " REVOKE ALL on pg_shadow FROM public" | \
386
- postgres -F -Q -D$PGDATA template1 2>&1 > /dev/null | \
387
- grep -v " 'DEBUG:"
379
+ valuntil FROM pg_shadow;" | \
380
+ postgres $PGSQL_OPT template1 > /dev/null
381
+ echo " REVOKE ALL on pg_shadow FROM public" | \
382
+ postgres $PGSQL_OPT template1 > /dev/null
388
383
389
384
echo " loading pg_description"
390
- echo " copy pg_description from '$TEMPLATE_DESCR '" | postgres -F -Q -D$PGDATA template1 > /dev/null
391
- echo " copy pg_description from '$GLOBAL_DESCR '" | postgres -F -Q -D$PGDATA template1 > /dev/null
392
- echo " vacuum analyze" | postgres -o /dev/null -F -Q -D$PGDATA template1
385
+ echo " copy pg_description from '$TEMPLATE_DESCR '" | \
386
+ postgres $PGSQL_OPT template1 > /dev/null
387
+ echo " copy pg_description from '$GLOBAL_DESCR '" | \
388
+ postgres $PGSQL_OPT template1 > /dev/null
389
+ echo " vacuum analyze" | \
390
+ postgres $PGSQL_OPT template1 > /dev/null
0 commit comments