Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions
Stephen Frost <sfrost@snowman.net>
From: Stephen Frost <sfrost@snowman.net>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Ian Barwick <ian.barwick@2ndquadrant.com>, Amit Kapila <amit.kapila16@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2019-06-21T15:24:52Z
Lists: 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
Commits
-
Doc: improve documentation about postgresql.auto.conf.
- e3ddb112f245 10.11 landed
- 7f77f2aec3d0 11.6 landed
- 57980bdf62f4 9.4.25 landed
- 45aaaa42fefa 13.0 landed
- 372d6a8918e0 12.0 landed
- 1ab92aaa97ce 9.5.20 landed
- 0969a7aa3240 9.6.16 landed
-
Fix ALTER SYSTEM to cope with duplicate entries in postgresql.auto.conf.
- f1bf619acdff 13.0 landed
- f8c9a08520ee 10.11 landed
- a4b0d955bd23 9.4.25 landed
- 75b2f011f642 12.0 landed
- 4784ad7a370e 9.6.16 landed
- 32d38f54a369 11.6 landed
- 29f9b1819a72 9.5.20 landed