pgsql: Replace SYSTEMQUOTEs with Windows-specific wrapper functions.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Replace SYSTEMQUOTEs with Windows-specific wrapper functions.
Date: 2014-05-05 13:08:32
Message-ID: E1WhIdE-0007vV-Cp@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Replace SYSTEMQUOTEs with Windows-specific wrapper functions.

It's easy to forget using SYSTEMQUOTEs when constructing command strings
for system() or popen(). Even if we fix all the places missing it now, it is
bound to be forgotten again in the future. Introduce wrapper functions that
do the the extra quoting for you, and get rid of SYSTEMQUOTEs in all the
callers.

We previosly used SYSTEMQUOTEs in all the hard-coded command strings, and
this doesn't change the behavior of those. But user-supplied commands, like
archive_command, restore_command, COPY TO/FROM PROGRAM calls, as well as
pgbench's \shell, will now gain an extra pair of quotes. That is desirable,
but if you have existing scripts or config files that include an extra
pair of quotes, those might need to be adjusted.

Reviewed by Amit Kapila and Tom Lane

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/a692ee5870f0f442565b4c4bff367094599e9bdf

Modified Files
--------------
configure.in | 1 +
contrib/pg_upgrade/check.c | 2 +-
contrib/pg_upgrade/controldata.c | 2 +-
contrib/pg_upgrade/exec.c | 4 +-
src/bin/initdb/initdb.c | 40 +++++-----
src/bin/pg_ctl/pg_ctl.c | 14 ++--
src/bin/pg_dump/pg_dumpall.c | 4 +-
src/bin/psql/command.c | 6 +-
src/include/port.h | 45 +++--------
src/interfaces/ecpg/test/pg_regress_ecpg.c | 2 +-
src/interfaces/libpq/Makefile | 6 +-
src/interfaces/libpq/bcc32.mak | 7 ++
src/interfaces/libpq/win32.mak | 7 ++
src/port/system.c | 117 ++++++++++++++++++++++++++++
src/test/isolation/isolation_main.c | 2 +-
src/test/regress/pg_regress.c | 26 +++----
src/test/regress/pg_regress_main.c | 2 +-
src/tools/msvc/Mkvcbuild.pm | 2 +-
18 files changed, 196 insertions(+), 93 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2014-05-05 13:23:25 pgsql: Assert that pre/post-fix updated tuples are on the same page dur
Previous Message Michael Paquier 2014-05-05 09:02:18 Re: pgsql: Add missing 9.4 release file.