pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: [COMMITTERS] pgsql: Make initdb's suggested "pg_ctl start" command line more reliabl
Date: Tue, 6 Sep 2016 12:19:31 -0400
Message-ID: <ef4f8751-b6c5-48ab-d2c3-ca2a270d5854@2ndquadrant.com> (raw)
In-Reply-To: <E1bbBaE-0001j6-Gz@gemulon.postgresql.org>
References: <E1bbBaE-0001j6-Gz@gemulon.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 8/20/16 3:05 PM, Tom Lane wrote:
> Make initdb's suggested "pg_ctl start" command line more reliable.
> 
> The original coding here was not nearly careful enough about quoting
> special characters, and it didn't get corner cases right for constructing
> the pg_ctl path either.  Use join_path_components() and appendShellString()
> to do it honestly, so that the string will more likely work if blindly
> copied-and-pasted.
> 
> While at it, teach appendShellString() not to quote strings that clearly
> don't need it, so that the output from initdb doesn't become uglier than
> it was before in typical cases where quoting is not needed.

A couple of problems with this:

The not-quoting-if-not-needed doesn't appear to do anything useful for me:

    'pg-install/bin/pg_ctl' -D 'pg-install/var/data' -l logfile start

The indentation of that line was changed from 4 to 10.  I don't think
that was a good change.

As just mentioned elsewhere, this accidentally introduces a failure if
the PostgreSQL installation path contains LF/CR, because of the use of
appendShellString().

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (8+ messages)  latest in thread

Message-ID: <ef4f8751-b6c5-48ab-d2c3-ca2a270d5854@2ndquadrant.com>
Permalink:  ../ef4f8751-b6c5-48ab-d2c3-ca2a270d5854@2ndquadrant.com/
Also on:    postgresql.org/message-id/ef4f8751-b6c5-48ab-d2c3-ca2a270d5854@2ndquadrant.com

 · 

reply

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-committers@postgresql.org
  Cc: peter.eisentraut@2ndquadrant.com, tgl@sss.pgh.pa.us, pgsql-hackers@postgresql.org
  Subject: Re: [COMMITTERS] pgsql: Make initdb's suggested "pg_ctl start" command line more reliabl
  In-Reply-To: <ef4f8751-b6c5-48ab-d2c3-ca2a270d5854@2ndquadrant.com>
  References: <E1bbBaE-0001j6-Gz@gemulon.postgresql.org> <ef4f8751-b6c5-48ab-d2c3-ca2a270d5854@2ndquadrant.com>

* 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