pgsql: Disallow newlines in parameter values to be set in ALTER SYSTEM.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Disallow newlines in parameter values to be set in ALTER SYSTEM.
Date: 2016-04-04 22:05:38
Message-ID: E1anCcs-0000GI-2D@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/99f3b5613bd1f145b5dbbe86000337bbe37fb094

Modified Files
--------------
src/backend/utils/misc/guc.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2016-04-05 00:18:28 Re: pgsql: Avoid archiving XLOG_RUNNING_XACTS on idle server
Previous Message Alvaro Herrera 2016-04-04 21:12:51 pgsql: Display WAL pointer in rm_redo error callback