From: Peter Eisentraut <peter_e@gmx.net>
To: Murray Cumming <murrayc@murrayc.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7514: postgres -k no longer works with spaces in the path
Date: Wed, 05 Sep 2012 18:57:05 -0400
Message-ID: <5047D8C1.3080504@gmx.net> (raw)
In-Reply-To: <1346782937.12346.21.camel@murayc-x220.fritz.box>
References: <E1T7f8j-0007MM-FJ@wrigleys.postgresql.org>
<16738.1346769101@sss.pgh.pa.us>
<1346782937.12346.21.camel@murayc-x220.fritz.box>
On 9/4/12 2:22 PM, Murray Cumming wrote:
> On Tue, 2012-09-04 at 10:31 -0400, Tom Lane wrote:
>> murrayc@murrayc.com writes:
>>> At some point, probably in 9.1.5, the -k option to Postgres ("Unix-domain
>>> socket location" in --help), stopped accepting paths that contain spaces.
>>
>>> For instance,
>>> -k '/tmp/testglom2FPDKW/path with spaces/some_postgres_data'
>>
>>> It now fails with this error:
>>> FATAL: invalid list syntax for "unix_socket_directories"
>>
>> Ah, you're using the latest Fedora packaging of 9.1.x, which includes a
>> back-ported version of the unix_socket_directories change that's in
>> HEAD. -k now effectively takes a list of directory names, not just
>> one, and it's pickier about whitespace.
>>
>> IIRC, you can make it work if you put double quotes around the
>> space-containing name, so it'd look like this:
>>
>> -k '"/blah blah blah"'
>
> Yes, thanks, that works for spaces, though it's rather odd.
>
> However, how should I now specify a path that has a " or a /, or \,
> which now cause similar errors with -k? Previously I could just use
> g_shell_quote() and forget about it:
> http://developer.gnome.org/glib/stable/glib-Shell-related-Utilities.html#g-shell-quote
>
> To be honest, I don't have much interest in, or understanding of, this
> -k option anyway. I just use it because, when starting my temporary
> postgresql instance, it otherwise defaults to /var/run/postgresql/ (at
> least in this distro build) which is not available to normal users. I
> currently just specify the same directory that the postgresql data is
> in. Maybe I should just use /tmp instead.
Maybe it would be easier if multiple -k options accumulated. That would
make the whole quoting business easier, and it would avoid breaking
compatibility.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: peter_e@gmx.net, murrayc@murrayc.com, tgl@sss.pgh.pa.us
Subject: Re: BUG #7514: postgres -k no longer works with spaces in the path
In-Reply-To: <5047D8C1.3080504@gmx.net>
References: <E1T7f8j-0007MM-FJ@wrigleys.postgresql.org> <16738.1346769101@sss.pgh.pa.us> <1346782937.12346.21.camel@murayc-x220.fritz.box> <5047D8C1.3080504@gmx.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox