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 1htfx5-0008Iq-EQ for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Aug 2019 22:23:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1htfx4-0000fQ-2Y for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Aug 2019 22:23:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1htfx3-0000eK-NM for pgsql-hackers@lists.postgresql.org; Fri, 02 Aug 2019 22:23:05 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1htfww-0003rW-BN for pgsql-hackers@postgresql.org; Fri, 02 Aug 2019 22:23:05 +0000 Received: by mail-wm1-x344.google.com with SMTP id w9so2357310wmd.1 for ; Fri, 02 Aug 2019 15:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=aoQGWB5oHz0EmAc3HJAz59S9+HxQ1s3S3WGwZVWlaCo=; b=e7N6RrrK4cc+/cvzxVGFOzHcE3k9x3lRpOXVVe+GP6CPQQtNCcHfMeHNLgqng8W5IR bfSY7U3hEQvkwcqT9k7g1i8nTvcDbmHYMJyQqGcHeqBFv1TNOrh5IeMGRJmMU3K6bL4V eKspYJ3c812klRsg4OeWmtTnUCIzv6cLIKwCmz2clDAuLjl+jkqzq+Wbfeq+Fus3jtkg PVNQfm0bRf+cf9kfCKfeXtnZlaCc9r8XpFfMaTmsy+agghkqS4Z6Yi+OVixoKg6iWseT B+z7SFIJcbtYnUXsB5UEQxGz4N+FRBNUmMlOnbCj91o4LbbQKrxSU1hAZ3+3+mNj5WtJ 3ycA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=aoQGWB5oHz0EmAc3HJAz59S9+HxQ1s3S3WGwZVWlaCo=; b=uefmGk4+zBp63at4dVynKcXlh/PtnDawFD1Oo/t5Y6WK6+3xrZ3Qb60doY29IStkDu kVVK7WyKwD7GXdRfSLDvvQD392STHuM4E0aLQ0hmh9ulrioybqfgoIVY+4f7Zn1UY3+g zKd7pqAs4sDtwJhgVzEGbBX/2P0t/H1zOTY1FWr92IzU/xtzsKToHV/04lOCxQVLcCS3 8RUlOyZRY4pyrZkL70gdoBXQStmoz0xnbXEZFMJr+OGEpICg9Vm5gI73nNXBehwKTRP9 X6ahygVsuWUgpOpF0Z6GL5JnDDXadR4ppVGG7BqyoqdAmqbXEZR2AoC+qosvCAKLqEOQ 7A9A== X-Gm-Message-State: APjAAAW505zn6METeBJ9dCIhh7ulBolyBTeW6PM/MQQrbbqqGqB87US1 AIuu9yaJxK2dR4o6Ntp8l5bm7g== X-Google-Smtp-Source: APXvYqzlejyY7qCmBLdTCyIkaOsnZTOOErv+PdeTFu2FDa8VHmR+yORbMt8rV8Kdi/Dau49dZSEbcw== X-Received: by 2002:a1c:a186:: with SMTP id k128mr5443569wme.74.1564784576176; Fri, 02 Aug 2019 15:22:56 -0700 (PDT) Received: from localhost (ip-86-49-253-160.net.upcbroadband.cz. [86.49.253.160]) by smtp.gmail.com with ESMTPSA id v16sm65032047wrn.28.2019.08.02.15.22.54 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 02 Aug 2019 15:22:55 -0700 (PDT) Date: Sat, 3 Aug 2019 00:22:54 +0200 From: Tomas Vondra To: Amit Kapila Cc: Ian Barwick , Stephen Frost , Tom Lane , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions Message-ID: <20190802222254.qsvqjtkwte464lu3@development> References: <20372.1561134638@sss.pgh.pa.us> <20190621164028.GO2480@tamriel.snowman.net> <21353.1561136112@sss.pgh.pa.us> <20190624185647.GW2480@tamriel.snowman.net> <15032.1561403529@sss.pgh.pa.us> <20190624192014.GB2480@tamriel.snowman.net> <56aff4f3-dec8-f462-7feb-0938411b04a6@2ndquadrant.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716-1444-295967 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, This thread discusses an issue that's tracked as an open item for pg12, but it's been quiet for the last ~1 month. I think it's probably time to decide what to do with it. The thread is a bit long, so let me sum what the issue is and what options we have. The problem is that ALTER SYSTEM does not handle duplicate entries in postgresql.auto.conf file correctly, because it simply modifies the first item, but the value is then overridden by the duplicate items. This contradicts the idea that duplicate GUCs are allowed, and that we should use the last item. This bug seems to exist since ALTER SYSTEM was introduced, so it's not a clear PG12 item. But it was made more prominent by the removal of recovery.conf in PG12, because pg_basebackup now appends stuff to postgresql.auto.conf and may easily create duplicate items. There seems to be a consensus that this this not a pg_basebackup issue (i.e. duplicate values don't make the file invalid), and it should be handled in ALTER SYSTEM. The proposal seems to be to run through the .auto.conf file, remove any duplicates, and append the new entry at the end. That seems reasonable. There was a discussion whether to print warnings about the duplicates. I personally see not much point in doing that - if we consider duplicates to be expected, and if ALTER SYSTEM has the license to rework the config file any way it wants, why warn about it? The main issue however is that no code was written yet. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services