Make initdb's suggested "pg_ctl start" command line more reliable.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 20 Aug 2016 19:05:25 +0000 (15:05 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 20 Aug 2016 19:05:25 +0000 (15:05 -0400)
commita00c58314745772f6c6a49b6d02a9572cd600bda
tree62c989a7460f4088ebcca979f20db9549c126e8c
parent6471045230f5d891ad724c54d406e2214f3c96d9
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.

Ryan Murphy, reviewed by Michael Paquier and myself

Discussion: <CAHeEsBeAe1FeBypT3E8R1ZVZU0e8xv3A-7BHg6bEOi=jZny2Uw@mail.gmail.com>
src/bin/initdb/Makefile
src/bin/initdb/initdb.c
src/fe_utils/string_utils.c