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

Commita7cdfdf

Browse files
committed
Fix pg_upgrade to notice if psql fails to execute the given
script, and not proceed with the update if so.Also add #!/bin/sh header line.
1 parent30b2d28 commita7cdfdf

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎src/bin/pg_dump/pg_upgrade‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
:
1+
#!/bin/sh
2+
#
3+
# pg_upgrade: update a database without needing a full dump/reload cycle
4+
# CAUTION: read the manual page before trying to use this!
5+
26
trap"rm -f /tmp/$$" 0 1 2 3 15
37

48
if ["$#"-eq 0 ]
@@ -67,6 +71,11 @@ cat $INPUT | awk '{
6771

6872
psql"template1"<"/tmp/$$"
6973

74+
if [$?-ne 0 ]
75+
thenecho"psql failed to execute$INPUT script."1>&2
76+
exit 1
77+
fi
78+
7079
forDIRin data/base/*
7180
do
7281
BASEDIR="`basename$DIR`"
@@ -86,4 +95,4 @@ done
8695
mv$OLDDIR/pg_log data
8796
mv$OLDDIR/pg_variable data
8897

89-
echo "You mayremoved the $OLDDIR directory with 'rm -r $OLDDIR'."
98+
echo"You mayremove the$OLDDIR directory with 'rm -r$OLDDIR'."

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp