]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Disallow newlines in parameter values to be set in ALTER SYSTEM.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 4 Apr 2016 22:05:23 +0000 (18:05 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 4 Apr 2016 22:05:23 +0000 (18:05 -0400)
commitf3d17491c49362b78da0c1a5b0691821dcc8c435
tree74290b4c8e1432744f396f3f3c22f1a13a9e1ea9
parent3644ac04c1ea27e596b77b7a02609b50b4742403
Disallow newlines in parameter values to be set in ALTER SYSTEM.

As noted by Julian Schauder in bug #14063, the configuration-file parser
doesn't support embedded newlines in string literals.  While there might
someday be a good reason to remove that restriction, there doesn't seem
to be one right now.  However, ALTER SYSTEM SET could accept strings
containing newlines, since many of the variable-specific value-checking
routines would just see a newline as whitespace.  This led to writing a
postgresql.auto.conf file that was broken and had to be removed manually.

Pending a reason to work harder, just throw an error if someone tries this.

In passing, fix several places in the ALTER SYSTEM logic that failed to
provide an errcode() for an ereport(), and thus would falsely log the
failure as an internal XX000 error.

Back-patch to 9.4 where ALTER SYSTEM was introduced.
src/backend/utils/misc/guc.c