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 1heMoo-0000pz-3h for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jun 2019 16:55:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1heMom-000802-Od for pgsql-hackers@arkaria.postgresql.org; Fri, 21 Jun 2019 16:55:16 +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 1heMom-0007zv-CS for pgsql-hackers@lists.postgresql.org; Fri, 21 Jun 2019 16:55:16 +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.89) (envelope-from ) id 1heMok-0005lG-5E for pgsql-hackers@postgresql.org; Fri, 21 Jun 2019 16:55:15 +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 x5LGtC8l021354; Fri, 21 Jun 2019 12:55:12 -0400 From: Tom Lane To: Stephen Frost cc: Robert Haas , Ian Barwick , Amit Kapila , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions In-reply-to: <20190621164028.GO2480@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> Comments: In-reply-to Stephen Frost message dated "Fri, 21 Jun 2019 12:40:28 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21352.1561136112.1@sss.pgh.pa.us> Date: Fri, 21 Jun 2019 12:55:12 -0400 Message-ID: <21353.1561136112@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Stephen Frost writes: > * Tom Lane (tgl@sss.pgh.pa.us) wrote: >> I haven't been paying too close attention to this thread, but isn't >> that exactly what it does now and always has? guc.c, at least, certainly >> is going to interpret duplicate entries that way. > The issue isn't with reading them and interpreting them, it's what > happens when you run ALTER SYSTEM and it goes and modifies the file. > Presently, it basically operates on the first entry it finds when > performing a SET or a RESET. 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. If you had some fancy setup with comments associated with entries, you might not be pleased with that. But I can't muster a lot of sympathy for tools putting comments in postgresql.auto.conf anyway; it's not intended to be a human-readable file. If anybody does complain, my first reaction would be to make ALTER SYSTEM strip all comment lines too. regards, tom lane