Fix initdb for path with whitespace and at char - Mailing list pgsql-hackers

From Nikhil Deshpande
Subject Fix initdb for path with whitespace and at char
Date
Msg-id CAH_aGJj4YbcL7V9c_iX_YZ4WJuxgydHNvR5JgwU0K+=abeiNeg@mail.gmail.com
Whole thread Raw
Responses Re: Fix initdb for path with whitespace and at char  (Heikki Linnakangas <hlinnakangas@vmware.com>)
List pgsql-hackers
Hi,

On win32, initdb fails if it's path includes a space and at ('@') character. E.g.

C:\>"C:\Program Files\user@company\Postgres\9.3\bin\initdb.exe" -D "c:\baz"
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

Here's a patch that fixes initdb by enclosing the command string in
extra double quotes being passed to popen() (similar to system() call).

Thanks,
 Nikhil 
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pg_dump --pretty-print-views
Next
From: Hello World
Date:
Subject: libpq: How to get the error code after a failed PGconn connection