Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heLPO-0005fK-S5 for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jun 2019 15:24:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1heLPM-00064I-15 for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jun 2019 15:24:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1heLPL-00064A-LP for pgsql-hackers@lists.postgresql.org; Fri, 21 Jun 2019 15:24:55 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1heLPI-0004eh-QE for pgsql-hackers@postgresql.org; Fri, 21 Jun 2019 15:24:54 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id BF2D15F7AA; Fri, 21 Jun 2019 11:24:52 -0400 (EDT) Date: Fri, 21 Jun 2019 11:24:52 -0400 From: Stephen Frost To: Robert Haas Cc: Ian Barwick , Amit Kapila , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions Message-ID: <20190621152452.GN2480@tamriel.snowman.net> References: <20190614160835.GF2480@tamriel.snowman.net> <20190616171610.GO2480@tamriel.snowman.net> <27dc9f8d-8d8f-9dd1-0494-5d8bd2f49a45@2ndquadrant.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gnqr8uuXGD2cvyzH" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --gnqr8uuXGD2cvyzH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Robert Haas (robertmhaas@gmail.com) wrote: > On Mon, Jun 17, 2019 at 10:50 AM Ian Barwick > wrote: > > In Pg12, the code in pg_basebackup implies the correct thing to do is a= ppend to .auto.conf, > > but as demonstrated that can cause problems with duplicate entries. >=20 > Yeah. >=20 > 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. >=20 > 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 --gnqr8uuXGD2cvyzH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJdDPbEAAoJEO1sijiDR2RVDfQQAL1WF1ZxrmCHbR+GMRlfUsHB eBweecqq/tNAq9HxlNomhPm/2Iej5EFdfhOFgmfCG/+UEt+EBW4nPCk8BjRWzSAm Et3SOMs03bX0Bl5SiuhMmlUQ61MHMjdkcSZjyPMBWBzeV2+4jquohl4dqCPrCyqZ Ei83yDsn164wih2mLWD3Fqz9UxX0hCMucfTcudBbJ8Lo8bJ6Oksm7xdVXuphAqfy 9ipa6er2jEW0LW+nkHJ31PUEChwV2J0Z/Ur5qe6lht3nC/YrnMDiQzw/WH8wNS0q Kla9ho7xZI64p5O5bjqoZZkszmw3+/YOlXTunw2IUBxVYlgkpqQD8h00UmmW1Lv7 IvspqW88UOrIvCa9d2vBaIyAZwKABeq2xOezT5YKx2aQVRANoehWTr4or5catJun rI4MJYXPuTloJkhTzje+Mw5aKFPhtDHOZQ5J7MyJy9leBWRvsWgnL/xeHDR+7n06 VrlWe+VuKi5yc+qzpv1SEobdCWaU/urBOQRQDPkiKjf+lmKhJNPdkodumR3ZFL99 pF0zMaAcSc9/Tp5zadQd7EN5FjbgB+y98Zo0tZgl7WPxEt+xqoM/CLBJZGtITZns bPYn+WQmvIWDN1yV5sd3NGB6wKJm3fRkkmvTubT2G0JKIlL3ADDhpf6eeiJfwrtY de/4trhDL/AafEUwCoea =N8O3 -----END PGP SIGNATURE----- --gnqr8uuXGD2cvyzH--