Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0279d55

Browse files
committed
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...
1 parent8dd692c commit0279d55

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

‎src/bin/initdb/initdb.sh

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#
2727
#
2828
# IDENTIFICATION
29-
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.39 1998/03/2218:28:39 scrappy Exp $
29+
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.40 1998/03/2219:35:30 scrappy Exp $
3030
#
3131
#-------------------------------------------------------------------------
3232

@@ -346,13 +346,14 @@ fi
346346

347347
echo
348348

349+
PGSQL_OPT="-o /dev/null -F -Q -D$PGDATA"
350+
349351
# If the COPY is first, the VACUUM generates an error, so we vacuum first
350352
echo"vacuuming template1"
351-
echo"vacuum"| postgres-o/dev/null -F -Q -D$PGDATA template1
353+
echo"vacuum"| postgres$PGSQL_OPT template1>/dev/null
352354

353-
echo"COPY pg_shadow TO '$PGDATA/pg_pwd' USING DELIMITERS '\\t'"|\
354-
postgres -F -Q -D$PGDATA template12>&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
356357

357358
echo"creating public pg_user view"
358359
echo"CREATE TABLE xpg_user (\
@@ -363,30 +364,27 @@ echo "CREATE TABLE xpg_user (\
363364
usesuperbool,\
364365
usecatupdbool,\
365366
passwdtext,\
366-
valuntilabstime);"|\
367-
postgres -F -Q -D$PGDATA template12>&1> /dev/null|\
368-
grep -v"'DEBUG:"
367+
valuntilabstime);"| postgres$PGSQL_OPT template1> /dev/null
369368

370369
#move it into pg_user
371370
echo"UPDATE pg_class SET relname = 'pg_user' WHERE relname = 'xpg_user';"|\
372-
postgres -F -Q -D$PGDATA template12>&1> /dev/null|\
373-
grep -v"'DEBUG:"
371+
postgres$PGSQL_OPT template1> /dev/null
374372
echo"UPDATE pg_type SET typname = 'pg_user' WHERE typname = 'xpg_user';"|\
375-
postgres -F -Q -D$PGDATA template12>&1> /dev/null|\
376-
grep -v"'DEBUG:"
373+
postgres$PGSQL_OPT template1> /dev/null
377374
mv$PGDATA/base/template1/xpg_user$PGDATA/base/template1/pg_user
378375

379376
echo"CREATE RULE _RETpg_user AS ON SELECT TO pg_user DO INSTEAD\
380377
SELECT usename, usesysid, usecreatedb, usetrace,\
381378
usesuper, usecatupd, '********'::text as passwd,\
382-
valuntil FROM pg_shadow;"|\
383-
postgres -F -Q -D$PGDATA template12>&1> /dev/null|\
384-
grep -v"'DEBUG:"
385-
echo"REVOKE ALL on pg_shadow FROM public"|\
386-
postgres -F -Q -D$PGDATA template12>&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
388383

389384
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

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp