pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au
7+ messages / 1 participants
[nested] [flat]

* pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au
@ 2019-08-14 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-14 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f1bf619acdff15b88b5729f8de6df4eed609b3a0

Modified Files
--------------
src/backend/utils/misc/guc.c | 47 +++++++++++++++++++++-----------------------
1 file changed, 22 insertions(+), 25 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au
@ 2019-08-14 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-14 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4784ad7a370ebdbde7aeaa9faf0f0c00b245f1a4

Modified Files
--------------
src/backend/utils/misc/guc.c | 47 +++++++++++++++++++++-----------------------
1 file changed, 22 insertions(+), 25 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au
@ 2019-08-14 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-14 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f8c9a08520eea2ea7f0197b878515d99861d6221

Modified Files
--------------
src/backend/utils/misc/guc.c | 47 +++++++++++++++++++++-----------------------
1 file changed, 22 insertions(+), 25 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au
@ 2019-08-14 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-14 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/32d38f54a369290cd5c5efb939c9f037a7c13e80

Modified Files
--------------
src/backend/utils/misc/guc.c | 47 +++++++++++++++++++++-----------------------
1 file changed, 22 insertions(+), 25 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au
@ 2019-08-14 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-14 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a4b0d955bd23bf82d461417d084d7d7abb397cb8

Modified Files
--------------
src/backend/utils/misc/guc.c | 47 +++++++++++++++++++++-----------------------
1 file changed, 22 insertions(+), 25 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au
@ 2019-08-14 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-14 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/75b2f011f642bbc7fab8352f4bcfb6e3fc494e7a

Modified Files
--------------
src/backend/utils/misc/guc.c | 47 +++++++++++++++++++++-----------------------
1 file changed, 22 insertions(+), 25 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au
@ 2019-08-14 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2019-08-14 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/29f9b1819a727c8f0818e265d6fbb4d197b6b15a

Modified Files
--------------
src/backend/utils/misc/guc.c | 47 +++++++++++++++++++++-----------------------
1 file changed, 22 insertions(+), 25 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2019-08-14 19:10 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-08-14 19:10 pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au Tom Lane <tgl@sss.pgh.pa.us>
2019-08-14 19:10 pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au Tom Lane <tgl@sss.pgh.pa.us>
2019-08-14 19:10 pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au Tom Lane <tgl@sss.pgh.pa.us>
2019-08-14 19:10 pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au Tom Lane <tgl@sss.pgh.pa.us>
2019-08-14 19:10 pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au Tom Lane <tgl@sss.pgh.pa.us>
2019-08-14 19:10 pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au Tom Lane <tgl@sss.pgh.pa.us>
2019-08-14 19:10 pgsql: Fix ALTER SYSTEM to cope with duplicate entries in postgresql.au Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox