Re: [COMMITTERS] pgsql: Make initdb's suggested "pg_ctl start" command line more reliabl

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [COMMITTERS] pgsql: Make initdb's suggested "pg_ctl start" command line more reliabl
Date: 2016-09-06 16:19:31
Message-ID: ef4f8751-b6c5-48ab-d2c3-ca2a270d5854@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2016-09-06 17:08:51 Re: Re: [COMMITTERS] pgsql: Make initdb's suggested "pg_ctl start" command line more reliabl
Previous Message Simon Riggs 2016-09-06 14:41:26 pgsql: Fix VACUUM_TRUNCATE_LOCK_WAIT_INTERVAL

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2016-09-06 16:21:39 Re: Fun fact about autovacuum and orphan temp tables
Previous Message Peter Eisentraut 2016-09-06 16:13:00 Re: Forbid use of LF and CR characters in database and role names