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 20190621152452.GN2480@tamriel.snowman.net
Whole thread Raw
In response to Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
List pgsql-hackers
Greetings,

* Robert Haas (robertmhaas@gmail.com) wrote:
> On Mon, Jun 17, 2019 at 10:50 AM Ian Barwick
> <ian.barwick@2ndquadrant.com> wrote:
> > In Pg12, the code in pg_basebackup implies the correct thing to do is append to .auto.conf,
> > but as demonstrated that can cause problems with duplicate entries.
>
> Yeah.
>
> To me, forcing every tools author to use postgresql.conf parsing tools
> rather than just appending to the file is a needless burden on tool
> authors.  I'd vote for just having ALTER SYSTEM silently drop all but
> the last of duplicated entries.
>
> It sounds like I might be in the minority, but I feel like the
> reactions which suggest that this is somehow heresy are highly
> overdone. Given that the very first time somebody wanted to do
> something like this in core, they picked this approach, I think we can
> assume that it is a natural approach which other people will also
> attempt. There doesn't seem to be any good reason for it not to Just
> Work.

That's not quite accurate, given that it isn't how the ALTER SYSTEM call
itself works, and clearly isn't how the authors of that feature expected
things to work or they would have actually made it work.  They didn't,
and it doesn't actually work.

The notion that pg_basebackup was correct in this, when it wasn't tested
at all, evidently, even after the concern was raised, and ALTER SYSTEM
was wrong, even though it worked just fine before some later patch
started making changes to the file, based on the idea that it's the
"natural approach" doesn't make sense to me.

If the change to pg_basebackup had included a change to ALTER SYSTEM to
make it work the *same* way that pg_basebackup now does, or at least to
work with the changes that pg_basebackup were making, then maybe
everything would have been fine.

That is to say, if your recommendation is to change everything that
modifies postgresql.auto.conf to *always* append (and maybe even include
a comment about when, and who, made the change..), and to make
everything work correctly with that, then that seems like it might be a
reasonable approach (though dealing with RESETs might be a little ugly..
haven't fully thought about that).

I still don't feel that having ALTER SYSTEM just remove duplicates is a
good idea and I do think it'll lead to confusion.

Thanks,

Stephen

Attachment

pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: allow_system_table_mods stuff
Next
From: Jim Finnerty
Date:
Subject: Re: Implementing Incremental View Maintenance