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

Commit3a3c1b8

Browse files
committed
From: Tom Lane <tgl@sss.pgh.pa.us>I see someone missed an ancient bit of shell-scripting lore:on some older shells, if your script's argument list is empty,then "$@" generates an empty-string word rather than no wordat all. You need to write ${1+"$@"} to get the latter behavior.(Read your shell man page to see exactly how that works,but it does the Right Thing on every Bourne shell.)In particular, pg_dumpall fails when invoked without any switcheson HPUX 9.*, because pg_dump gets an empty-string argument that itthinks is the name of the database to dump. I expect this bugalso affects some other OSes, but couldn't tell you just which ones.Patch attached.
1 parentbd029bc commit3a3c1b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎src/bin/pg_dump/pg_dumpall

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ do
5858
echo"${BS}connect template1$POSTGRES_USER"
5959
echo"create database$DATABASE;"
6060
echo"${BS}connect$DATABASE$POSTGRES_USER"
61-
pg_dump"$@"$DATABASE
61+
pg_dump${1+"$@"}$DATABASE
6262
if ["$?" -ne 0 ]
6363
thenecho"pg_dump failed on$DATABASE, exiting" 1>&2
6464
exit 1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp