Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T9OX0-0002j1-AQ for pgsql-bugs@postgresql.org; Wed, 05 Sep 2012 22:57:10 +0000 Received: from eisentraut.org ([85.214.91.16] helo=gattler.pezone.net) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1T9OWy-0008VM-6r for pgsql-bugs@postgresql.org; Wed, 05 Sep 2012 22:57:09 +0000 Received: from jesse.mybdev.com (unknown [204.145.120.11]) by gattler.pezone.net (Postfix) with ESMTPSA id E428F5A8564; Wed, 5 Sep 2012 22:57:06 +0000 (UTC) Message-ID: <5047D8C1.3080504@gmx.net> Date: Wed, 05 Sep 2012 18:57:05 -0400 From: Peter Eisentraut User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120824 Thunderbird/15.0 MIME-Version: 1.0 To: Murray Cumming CC: Tom Lane , pgsql-bugs@postgresql.org Subject: Re: BUG #7514: postgres -k no longer works with spaces in the path References: <16738.1346769101@sss.pgh.pa.us> <1346782937.12346.21.camel@murayc-x220.fritz.box> In-Reply-To: <1346782937.12346.21.camel@murayc-x220.fritz.box> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201209/37 X-Sequence-Number: 34032 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.