From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Ian Barwick <ian.barwick@2ndquadrant.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Date: Mon, 24 Jun 2019 14:53:42 -0400
Message-ID: <14328.1561402422@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoZVx-vco-39EN9MxO9BaG-oVY+NuDeZPGdS=_bX5VH70w@mail.gmail.com>
References: <aed6cc9f-98f3-2693-ac81-52bb0052307e@2ndquadrant.com>
<20190614160835.GF2480@tamriel.snowman.net>
<CAA4eK1JW9UfLOtMEJq5b_YcogbWdxzAGUzNi72F2Xx4r1_h6QA@mail.gmail.com>
<20190616171610.GO2480@tamriel.snowman.net>
<27dc9f8d-8d8f-9dd1-0494-5d8bd2f49a45@2ndquadrant.com>
<CA+TgmobVjrvVQB_gVytgBcPRmBvptN3wHQy5T6=dYCDZ5n5MGA@mail.gmail.com>
<20372.1561134638@sss.pgh.pa.us>
<20190621164028.GO2480@tamriel.snowman.net>
<21353.1561136112@sss.pgh.pa.us>
<CA+TgmoZVx-vco-39EN9MxO9BaG-oVY+NuDeZPGdS=_bX5VH70w@mail.gmail.com>
Robert Haas <robertmhaas@gmail.com> writes:
> On Fri, Jun 21, 2019 at 12:55 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Ah, got it. So it seems like the correct behavior might be for
>> ALTER SYSTEM to
>> (a) run through the whole file and remove any conflicting lines;
>> (b) append new setting at the end.
> That is exactly the behavior for which I am arguing. Stephen also
> wants a warning, but I disagree, because the warning is totally
> non-actionable. It tells you that some tool, at some point in the
> past, did something bad. You can't do anything about that, and you
> wouldn't need to except for the arbitrary decision to label duplicate
> lines as bad in the first place.
Agreed; there's no particular reason to consider the situation as wrong.
guc.c has always had the policy that dups are fine and the last one wins.
The very design of ALTER SYSTEM owes its workability to that policy, so
we can hardly say that A.S. should have a different policy internally.
The problem here is simply that ALTER SYSTEM is failing to consider the
possibility that there are dups in postgresql.auto.conf, and that seems
like little more than an oversight to be fixed.
There's more than one way we could implement a fix, perhaps, but I don't
really see a reason to work harder than is sketched above.
(BTW, has anyone checked whether ALTER SYSTEM RESET is prepared to remove
multiple lines for the same var?)
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com, sfrost@snowman.net, ian.barwick@2ndquadrant.com, amit.kapila16@gmail.com
Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
In-Reply-To: <14328.1561402422@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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