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

Commitbfa3b59

Browse files
committed
initdb didn't load pg_description
1 parente419b48 commitbfa3b59

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

‎src/bin/initdb/initdb.sh

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,18 @@
2626
#
2727
#
2828
# IDENTIFICATION
29-
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.77 1999/12/22 04:23:31 ishii Exp $
29+
# $Header: /cvsroot/pgsql/src/bin/initdb/Attic/initdb.sh,v 1.78 2000/01/13 18:22:10 petere Exp $
3030
#
3131
#-------------------------------------------------------------------------
3232

3333
exit_nicely(){
3434
echo
3535
echo"$CMDNAME failed."
36-
if ["$noclean"-eq 0 ]
37-
then
36+
if ["$noclean"-eq 0 ];then
3837
echo"Removing$PGDATA."
3938
rm -rf"$PGDATA"||echo"Failed."
39+
echo"Removing temp file$TEMPFILE."
40+
rm -rf"$TEMPFILE"||echo"Failed."
4041
else
4142
echo"Data directory$PGDATA will not be removed at user's request."
4243
fi
@@ -53,7 +54,11 @@ then
5354
fi
5455

5556
EffectiveUser=`id -n -u2>/dev/null|| whoami2>/dev/null`
56-
TEMPFILE="/tmp/initdb.$$"
57+
if ["$TMPDIR" ];then
58+
TEMPFILE="$TMPDIR/initdb.$$"
59+
else
60+
TEMPFILE="/tmp/initdb.$$"
61+
fi
5762

5863
#
5964
# Find out where we're located
@@ -547,10 +552,17 @@ echo "CREATE VIEW pg_indexes AS \
547552
|"$PGPATH"/postgres$PGSQL_OPT template1> /dev/null|| exit_nicely
548553

549554
echo"Loading pg_description."
550-
echo"COPY pg_description FROM '$TEMPLATE_DESCR'" \
551-
|"$PGPATH"/postgres$PGSQL_OPT template1> /dev/null|| exit_nicely
552-
echo"COPY pg_description FROM '$GLOBAL_DESCR'" \
555+
echo"COPY pg_description FROM STDIN">$TEMPFILE
556+
cat"$TEMPLATE_DESCR">>$TEMPFILE
557+
cat"$GLOBAL_DESCR">>$TEMPFILE
558+
559+
cat$TEMPFILE \
553560
|"$PGPATH"/postgres$PGSQL_OPT template1> /dev/null|| exit_nicely
561+
if ["$noclean"-eq 0 ]
562+
then
563+
rm -f"$TEMPFILE"|| exit_nicely
564+
fi
565+
554566
echo"Vacuuming database."
555567
echo"VACUUM ANALYZE" \
556568
|"$PGPATH"/postgres$PGSQL_OPT template1> /dev/null|| exit_nicely

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp