pgsql: createdb: Fix quoting of --encoding, --lc-ctype and --lc-collate - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: createdb: Fix quoting of --encoding, --lc-ctype and --lc-collate
Date
Msg-id E1j78pp-0005GH-Bu@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
createdb: Fix quoting of --encoding, --lc-ctype and --lc-collate

The original coding failed to properly quote those arguments, leading to
failures when using quotes in the values used.  As the quoting can be
encoding-sensitive, the connection to the backend needs to be taken
before applying the correct quoting.

Author: Michael Paquier
Reviewed-by: Daniel Gustafsson
Discussion: https://postgr.es/m/20200214041004.GB1998@paquier.xyz
Backpatch-through: 9.5

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/943affb3d1db38ba0960ee9a0666ea2598b78f1f

Modified Files
--------------
src/bin/scripts/createdb.c        | 29 +++++++++++++++++++----------
src/bin/scripts/t/020_createdb.pl | 26 +++++++++++++++++++++++++-
2 files changed, 44 insertions(+), 11 deletions(-)


pgsql-committers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: pgsql: Silence compiler warning in nbtinsert.c.
Next
From: Robert Haas
Date:
Subject: pgsql: Move src/backend/utils/hash/hashfn.c to src/common