postgresql/src/backend/utils
Tom Lane 29f9b1819a Fix ALTER SYSTEM to cope with duplicate entries in postgresql.auto.conf.
ALTER SYSTEM itself normally won't make duplicate entries (although
up till this patch, it was possible to confuse it by writing case
variants of a GUC's name).  However, if some external tool has appended
entries to the file, that could result in duplicate entries for a single
GUC name.  In such a situation, ALTER SYSTEM did exactly the wrong thing,
because it replaced or removed only the first matching entry, leaving
the later one(s) still there and hence still determining the active value.

This patch fixes that by making ALTER SYSTEM sweep through the file and
remove all matching entries, then (if not ALTER SYSTEM RESET) append the
new setting to the end.  This means entries will be in order of last
setting rather than first setting, but that shouldn't hurt anything.

Also, make the comparisons case-insensitive so that the right things
happen if you do, say, ALTER SYSTEM SET "TimeZone" = 'whatever'.

This has been broken since ALTER SYSTEM was invented, so back-patch
to all supported branches.

Ian Barwick, with minor mods by me

Discussion: https://postgr.es/m/aed6cc9f-98f3-2693-ac81-52bb0052307e@2ndquadrant.com
2019-08-14 15:09:20 -04:00
..
adt Fix some incorrect parsing of time with time zone strings 2019-08-07 18:17:57 +09:00
cache Don't access catalogs to validate GUCs when not connected to a DB. 2019-06-10 23:36:59 -07:00
error Disallow setting client_min_messages higher than ERROR. 2018-11-08 17:33:26 -05:00
fmgr Add a utility function to extract variadic function arguments 2017-10-25 07:20:37 -04:00
hash Reorganize our CRC source files again. 2015-04-14 17:03:42 +03:00
init Consistently test for in-use shared memory. 2019-04-12 22:41:42 -07:00
mb Fail pgwin32_message_to_UTF16() for SQL_ASCII messages. 2019-05-12 10:34:22 -07:00
misc Fix ALTER SYSTEM to cope with duplicate entries in postgresql.auto.conf. 2019-08-14 15:09:20 -04:00
mmgr Handle elog(FATAL) during ROLLBACK more robustly. 2017-08-14 15:43:20 -04:00
resowner Update copyright for 2015 2015-01-06 11:43:47 -05:00
sort Fix actual and potential double-frees around tuplesort usage. 2018-03-28 13:26:43 -04:00
time Fix pruning of locked and updated tuples. 2017-12-14 18:20:48 -08:00
.gitignore Avoid maintaining three separate copies of the error codes list. 2011-02-03 22:32:49 -05:00
errcodes.txt Redesign tablesample method API, and do extensive code review. 2015-07-25 14:39:00 -04:00
Gen_dummy_probes.pl Remove dependency on psed for MSVC builds. 2016-03-19 18:44:04 -04:00
Gen_dummy_probes.sed Update copyright for 2015 2015-01-06 11:43:47 -05:00
Gen_fmgrtab.pl Allow forcing nullness of columns during bootstrap. 2015-02-21 22:31:54 +01:00
generate-errcodes.pl Update copyright for 2015 2015-01-06 11:43:47 -05:00
Makefile Fix make rules that generate multiple output files. 2018-03-23 13:45:38 -04:00
probes.d Update copyright for 2015 2015-01-06 11:43:47 -05:00