Re: BUG #7514: postgres -k no longer works with spaces in the path

From: Murray Cumming <murrayc(at)murrayc(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7514: postgres -k no longer works with spaces in the path
Date: 2012-09-04 18:22:17
Message-ID: 1346782937.12346.21.camel@murayc-x220.fritz.box
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, 2012-09-04 at 10:31 -0400, Tom Lane wrote:
> murrayc(at)murrayc(dot)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.

--
murrayc(at)murrayc(dot)com
www.murrayc.com
www.openismus.com

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2012-09-04 19:14:22 Re: BUG #6704: ALTER EXTENSION postgis SET SCHEMA leaves dangling relations
Previous Message Bruce Momjian 2012-09-04 18:01:54 Re: BUG #6528: pglesslog still referenced in docs, but no 9.1 support