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 1hv5a2-0007Lo-OC for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Aug 2019 19:57:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hv5a1-0007Px-Hh for pgsql-hackers@arkaria.postgresql.org; Tue, 06 Aug 2019 19:57:09 +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 1hv5a1-0007KG-3j for pgsql-hackers@lists.postgresql.org; Tue, 06 Aug 2019 19:57:09 +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 1hv5Zy-0005HZ-PV for pgsql-hackers@postgresql.org; Tue, 06 Aug 2019 19:57:07 +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 x76Jv35S005880; Tue, 6 Aug 2019 15:57:03 -0400 From: Tom Lane To: Ian Barwick cc: Stephen Frost , Robert Haas , Tomas Vondra , Amit Kapila , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions In-reply-to: <54620b18-60b7-4b9b-7d1d-90a6464ab333@2ndquadrant.com> References: <20190805172935.GK29202@tamriel.snowman.net> <30179.1565029753@sss.pgh.pa.us> <30823.1565030571@sss.pgh.pa.us> <32103.1565032053@sss.pgh.pa.us> <20190806005225.GM29202@tamriel.snowman.net> <6cba0dff-485b-6781-d659-0a376b966c89@2ndquadrant.com> <20190806021616.GP29202@tamriel.snowman.net> <54620b18-60b7-4b9b-7d1d-90a6464ab333@2ndquadrant.com> Comments: In-reply-to Ian Barwick message dated "Tue, 06 Aug 2019 14:53:10 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <5878.1565121423.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 06 Aug 2019 15:57:03 -0400 Message-ID: <5879.1565121423@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ian Barwick writes: > On 8/6/19 11:16 AM, Stephen Frost wrote: >>> Erm, those are duplicates though and we're saying that ALTER SYSTEM >>> removes those... Seems like we should be normalizing the file to be >>> consistent in this regard too. > True. (Switches brain on)... Ah yes, with the patch previously provided > by Tom, it seems to be just a case of replacing "strcmp" with "guc_name_= compare" > to match the existing string; the name will be rewritten with the value = provided > to ALTER SYSTEM, which will be normalized to lower case anyway. Good catch. >>> I dislike the special-casing of ALTER SYSTEM here, where we're basical= ly >>> saying that only ALTER SYSTEM is allowed to do this cleanup and that i= f >>> such cleanup is wanted then ALTER SYSTEM must be run. > This is just saying what ALTER SYSTEM will do, which IMHO we should desc= ribe > somewhere. Initially when I stated working with pg.auto.conf I had > my application append a comment line to show where the entries came from= , > but not having any idea how pg.auto.conf was modified at that point, I w= as > wondering why the comment subsequently disappeared. Perusing the source = code has > explained that for me, but would be mighty useful to document that. I feel fairly resistant to making the config.sgml explanation much longer than what I wrote. That chapter is material that every Postgres DBA has to absorb, so we should *not* be burdening it with stuff that few people need to know. Perhaps we could put some of these details into the Notes section of the ALTER SYSTEM ref page. But I wonder how much of this is needed at all. regards, tom lane