]> git.ipfire.org Git - thirdparty/postgresql.git/commit
createdb: Fix quoting of --encoding, --lc-ctype and --lc-collate
authorMichael Paquier <michael@paquier.xyz>
Thu, 27 Feb 2020 02:21:00 +0000 (11:21 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 27 Feb 2020 02:21:00 +0000 (11:21 +0900)
commit943affb3d1db38ba0960ee9a0666ea2598b78f1f
tree564e33b98c1c64b782061052a929b3681e31ca80
parent30d5c6bf2e09fe76448e59e9889ab5b38171da34
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
src/bin/scripts/createdb.c
src/bin/scripts/t/020_createdb.pl