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 1huiFU-0006pD-Cc for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Aug 2019 19:02:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1huiFT-0005Dm-7B for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Aug 2019 19:02:23 +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 1huiFS-000509-Op for pgsql-hackers@lists.postgresql.org; Mon, 05 Aug 2019 19:02:22 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1huiFO-0000pp-L5 for pgsql-hackers@postgresql.org; Mon, 05 Aug 2019 19:02:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x75J2FSk031813; Mon, 5 Aug 2019 15:02:15 -0400 From: Tom Lane To: Robert Haas cc: Stephen Frost , Amit Kapila , Ian Barwick , Tomas Vondra , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions In-reply-to: References: <15032.1561403529@sss.pgh.pa.us> <20190624192014.GB2480@tamriel.snowman.net> <56aff4f3-dec8-f462-7feb-0938411b04a6@2ndquadrant.com> <20190802222254.qsvqjtkwte464lu3@development> <31697.1564784856@sss.pgh.pa.us> <20190802230011.dqokdhjptykopxxc@development> <20190805142139.GW29202@tamriel.snowman.net> <20190805172935.GK29202@tamriel.snowman.net> <30179.1565029753@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Mon, 05 Aug 2019 14:47:39 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <31811.1565031735.1@sss.pgh.pa.us> Date: Mon, 05 Aug 2019 15:02:15 -0400 Message-ID: <31812.1565031735@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > But that's not the problem. The problem is that ALTER SYSTEM modifies > the first match instead of the last one, when it's a well-established > principle that when reading from a PostgreSQL configuration file, the > system adopts the value from the last match, not the first one. I > admit that if somebody had thought to document what ALTER SYSTEM was > doing, that person would probably have also realized that they had > made a mistake in the code, and then they would have fixed the bug, > and that would be great. Well, actually, the existing code is perfectly clear about this: /* Search the list for an existing match (we assume there's only one) */ That assumption is fine *if* you grant that only ALTER SYSTEM itself is authorized to write that file. I think the real argument here centers around who else is authorized to write the file, and when and how. In view of the point you made upthread that we explicitly made pg.auto.conf a plain text file so that one could recover from mistakes by hand-editing it, I think it's pretty silly to adopt a position that external mods are disallowed. regards, tom lane