postgresql/src
Tom Lane a56c11d44d Further fixes for quoted-list GUC values in pg_dump and ruleutils.c.
Commits 742869946 et al turn out to be a couple bricks shy of a load.
We were dumping the stored values of GUC_LIST_QUOTE variables as they
appear in proconfig or setconfig catalog columns.  However, although that
quoting rule looks a lot like SQL-identifier double quotes, there are two
critical differences: empty strings ("") are legal, and depending on which
variable you're considering, values longer than NAMEDATALEN might be valid
too.  So the current technique fails altogether on empty-string list
entries (as reported by Steven Winfield in bug #15248) and it also risks
truncating file pathnames during dump/reload of GUC values that are lists
of pathnames.

To fix, split the stored value without any downcasing or truncation,
and then emit each element as a SQL string literal.

This is a tad annoying, because we now have three copies of the
comma-separated-string splitting logic in varlena.c as well as a fourth
one in dumputils.c.  (Not to mention the randomly-different-from-those
splitting logic in libpq...)  I looked at unifying these, but it would
be rather a mess unless we're willing to tweak the API definitions of
SplitIdentifierString, SplitDirectoriesString, or both.  That might be
worth doing in future; but it seems pretty unsafe for a back-patched
bug fix, so for now accept the duplication.

Back-patch to all supported branches, as the previous fix was.

Discussion: https://postgr.es/m/7585.1529435872@sss.pgh.pa.us
2018-07-31 13:00:08 -04:00
..
backend Further fixes for quoted-list GUC values in pg_dump and ruleutils.c. 2018-07-31 13:00:08 -04:00
bin Further fixes for quoted-list GUC values in pg_dump and ruleutils.c. 2018-07-31 13:00:08 -04:00
common Adjust error message 2018-06-11 17:19:11 -04:00
fe_utils Post-feature-freeze pgindent run. 2018-04-26 14:47:16 -04:00
include Further fixes for quoted-list GUC values in pg_dump and ruleutils.c. 2018-07-31 13:00:08 -04:00
interfaces Fix error message when a hostaddr cannot be parsed. 2018-07-19 20:24:59 +03:00
makefiles Remove Windows module-list-dumping code. 2018-04-30 13:20:13 -04:00
pl Provide plpgsql tests for cases involving record field changes. 2018-07-26 18:18:42 -04:00
port Guard against rare RAND_bytes() failures in pg_strong_random(). 2018-07-20 08:57:08 +01:00
template Force "restrict" not to be used when compiling with xlc. 2017-10-13 12:15:06 -07:00
test Further fixes for quoted-list GUC values in pg_dump and ruleutils.c. 2018-07-31 13:00:08 -04:00
timezone Update time zone data files to tzdata release 2018e. 2018-05-09 13:56:22 -04:00
tools pgtest: run clean, build, and check stages separately 2018-07-28 15:34:06 -04:00
tutorial Update copyright for 2018 2018-01-02 23:30:12 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Ensure we build generated headers at the start of some more cases. 2018-07-30 18:04:39 -04:00
Makefile.shlib Prevent accidental linking of system-supplied copies of libpq.so etc. 2018-04-03 16:26:05 -04:00
nls-global.mk nls-global.mk: search build dir for source files, too 2016-06-07 18:55:18 -04:00