Fix initdb for path with whitespace and at char

From: Nikhil Deshpande <nikhail(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Fix initdb for path with whitespace and at char
Date: 2014-04-29 18:14:32
Message-ID: CAH_aGJj4YbcL7V9c_iX_YZ4WJuxgydHNvR5JgwU0K+=abeiNeg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

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

C:\>"C:\Program Files\user(at)company\Postgres\9(dot)3\bin\initdb(dot)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 Content-Type Size
0001-Fix-initdb-for-path-with-whitespace-and-at-char.patch application/octet-stream 5.4 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hello World 2014-04-29 18:19:03 libpq: How to get the error code after a failed PGconn connection
Previous Message Tom Lane 2014-04-29 18:11:35 Re: pg_dump --pretty-print-views