Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Date
Msg-id CAOuzzgqNyQM_z0biEEBVBK9WcaLmbCyWrd5xTdf-Oxb_9pntLA@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions  (Andres Freund <andres@anarazel.de>)
Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
List pgsql-hackers
Greetings,

On Fri, Aug 2, 2019 at 18:27 Tom Lane <tgl@sss.pgh.pa.us> wrote:
Tomas Vondra <tomas.vondra@2ndquadrant.com> writes:
> There seems to be a consensus that this this not a pg_basebackup issue
> (i.e. duplicate values don't make the file invalid), and it should be
> handled in ALTER SYSTEM.

Yeah.  I doubt pg_basebackup is the only actor that can create such
situations.

> The proposal seems to be to run through the .auto.conf file, remove any
> duplicates, and append the new entry at the end. That seems reasonable.

+1

I disagree that this should only be addressed in alter system, as I’ve said before and as others have agreed with.  Having one set of code that can be used to update parameters in the auto.conf and then have that be used by pg_basebackup, alter system, and external tools, is the right approach.

The idea that alter system should be the only thing that doesn’t just append changes to the file is just going to lead to confusion and bugs down the road.

As I said before, an alternative could be to make alter system simply always append and declare that to be the way to update parameters in the auto.conf.

> There was a discussion whether to print warnings about the duplicates. I
> personally see not much point in doing that - if we consider duplicates
> to be expected, and if ALTER SYSTEM has the license to rework the config
> file any way it wants, why warn about it?

Personally I agree that warnings are unnecessary.

And at least Magnus and I disagree with that, as I recall from this thread.  Let’s have a clean and clear way to modify the auto.conf and have everything that touches the file update it in a consistent way.

Thanks,

Stephen

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Next
From: Ian Barwick
Date:
Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions