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 1hfUOk-000149-Oo for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jun 2019 19:13:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hfUOj-0006tZ-Jv for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jun 2019 19:13:01 +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 1hfUOj-0006ru-7I for pgsql-hackers@lists.postgresql.org; Mon, 24 Jun 2019 19:13:01 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by makus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hfUOg-0004hh-MK for pgsql-hackers@postgresql.org; Mon, 24 Jun 2019 19:12:59 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id CAB135F7B1; Mon, 24 Jun 2019 15:12:58 -0400 (EDT) Date: Mon, 24 Jun 2019 15:12:58 -0400 From: Stephen Frost To: Tom Lane Cc: Robert Haas , Ian Barwick , Amit Kapila , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions Message-ID: <20190624191258.GZ2480@tamriel.snowman.net> References: <20190614160835.GF2480@tamriel.snowman.net> <20190616171610.GO2480@tamriel.snowman.net> <27dc9f8d-8d8f-9dd1-0494-5d8bd2f49a45@2ndquadrant.com> <20372.1561134638@sss.pgh.pa.us> <20190621164028.GO2480@tamriel.snowman.net> <21353.1561136112@sss.pgh.pa.us> <14328.1561402422@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fUAgMX1mmt35sX2N" Content-Disposition: inline In-Reply-To: <14328.1561402422@sss.pgh.pa.us> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --fUAgMX1mmt35sX2N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Robert Haas writes: > > On Fri, Jun 21, 2019 at 12:55 PM Tom Lane 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. >=20 > > 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. >=20 > 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. >=20 > 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. >=20 > 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. Why bother removing the duplicate lines? If ALTER SYSTEM should remove them, why shouldn't other tools? > (BTW, has anyone checked whether ALTER SYSTEM RESET is prepared to remove > multiple lines for the same var?) No, it doesn't handle that today either, as discussed earlier in this thread. If we want to get to should/must kind of language, then we could say that tools should remove duplicated values, and must append to the end, but I'm not sure that really changes things from what I'm proposing anyway. Thanks, Stephen --fUAgMX1mmt35sX2N Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJdESC6AAoJEO1sijiDR2RV4mMP/Au4Pr09xo0VJoT0SY5Sqty3 EIvrXt7CX1IwBxCnQQznUaqzbOs5Y8X30K7WuLjJhtthTSJdVeZPpljRfPA9PwDn suos1SDvcTMeHwmIejGye5n6zqaQr7zQHfTX7Szmqs0nH4+BamNHdiGpmuIAgzRh TbIMnPOcDAR0u1l3GtWBOpvTCLi3EvfSMsFHY0QtgjF3H3W5WnQ3sNzIjO6iWAvr IGyU+eUtfbq7LX+JCpwoJZLZXJkGALwey9FbM965ilRmbKeFOFk+D+xKp8Pl2/oW cK798Kh2BYpN6OdscH4HWH6BWiRaTr1Kx0POzgmiiPi5LMPRgA1XyGl1Kt1REg0L jzl1jDIgTeLmrHJ60Zbb/oL7p2RCdiMweZEAmxY7bkNSrBaTy5vwOKNllSy6vjM0 LFMSrWaAV7GSQtJssV/IbkfVEXcdx/v+/zLs2M9XSGUBj2ZbW8eE4bKfprh3D13Q 4TCPvaSfKY5sC28boKcq4MhR/ueh9idQnEnCldKoRz1BZ1U6TOTESHLLJv+weLYJ fdtKGGngyRL0/0Q9CzWfjrozS8mn7+0wtBeVo8MiBvDpWLJH8AyvUfEj1h2XdgYG GwbBMT/WK1ZrUfMBgD49ZAdw/jnazYMyNyZ4QfMmx11J02XEEfVbtHXtX3R3vPkQ jL3frMFwXZ1TBULgKPix =o4a2 -----END PGP SIGNATURE----- --fUAgMX1mmt35sX2N--