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 1htgX5-000166-7L for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Aug 2019 23:00:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1htgX4-0004qS-1N for pgsql-hackers@arkaria.postgresql.org; Fri, 02 Aug 2019 23:00:18 +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 1htgX3-0004pw-Op for pgsql-hackers@lists.postgresql.org; Fri, 02 Aug 2019 23:00:17 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1htgX0-0004HQ-KW for pgsql-hackers@postgresql.org; Fri, 02 Aug 2019 23:00:17 +0000 Received: by mail-wm1-x341.google.com with SMTP id v15so69370824wml.0 for ; Fri, 02 Aug 2019 16:00:14 -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:content-transfer-encoding:in-reply-to :user-agent; bh=IcQ6ljS017T6DpC91fTFz27ijf6n3EaI3bN+PzKMqLM=; b=hmqyDGhpn//Ttar/fmLnxkTK7/k45hONrbgslqez3P05m++PpTjKmQt+iXN1SnhsWG 4XC0laRMrmQdWNjbJnOYw1Ui2aWcnmvjthENIj9I02VjYJ9wIWprFZW8Ng8ckqJr0ZGP 9k0kFsO3eQRx2cIAtfl5Oiobd7zCbUmpZsORcYabDWvqYbA7PbgfA8TcY418C5AittXW 1C7sJ1EkwKubSLhY9Cw1fzJj0cns5NhcKpbVUAsRjs7vfne90egwisvNF3OJUVEDn1R5 KHfEReqZuV1ZdHPVnl2uxi4dMqs77393paristzwLbFYq6DdQJx9ytlcVuzOdH7rPZyl 5foA== 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:content-transfer-encoding :in-reply-to:user-agent; bh=IcQ6ljS017T6DpC91fTFz27ijf6n3EaI3bN+PzKMqLM=; b=DX7wI5ofjQikFXdwRyA1JDM/G+n/l+jwzbrDF41IBc5cLEKe8B/EL0JQiohD6qVvjd VY4mReKawySBdwRnxeK+zwvkhgNm14o0JFs7lINFhLVC48E9oFdMBHvjEygLW7CSorae uMGERPU/n65lzYyNdAM3o6m6O8c9XsgAQGjRA0AFFkHrhfyiShqslOqF2NWw4EyiyVil Ol8XJfbniRCNO7Hgu1tX5ez/BPtLLxCpBPMG48KhGtDF3S96yCL3svkvM793mjGfDkJ0 g3qG099eCQS3Oho+RmgyovaghtqGIaIn24icby1y7Xc1i3bJBDr5sw7mbky5dG5ilRCs c1GQ== X-Gm-Message-State: APjAAAVImKytBnXiuGlinHcAjYs1nPC+xr+ubYIeI73Yb354SDTvjxON xVOi3DaO59peVVrWzUPo8g5Dww== X-Google-Smtp-Source: APXvYqwKVURDs8GQaAIJ3o/BeO6SZf9g1HS/j0Yn635duXVbgbg6Z76xHa6WX2dmA3oOOxhPxYs8cg== X-Received: by 2002:a1c:9dc5:: with SMTP id g188mr6126375wme.93.1564786813430; Fri, 02 Aug 2019 16:00:13 -0700 (PDT) Received: from localhost (ip-86-49-253-160.net.upcbroadband.cz. [86.49.253.160]) by smtp.gmail.com with ESMTPSA id t13sm93035535wrr.0.2019.08.02.16.00.12 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 02 Aug 2019 16:00:12 -0700 (PDT) Date: Sat, 3 Aug 2019 01:00:11 +0200 From: Tomas Vondra To: Stephen Frost Cc: Tom Lane , Amit Kapila , Ian Barwick , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions Message-ID: <20190802230011.dqokdhjptykopxxc@development> References: <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> <20190802222254.qsvqjtkwte464lu3@development> <31697.1564784856@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716-1444-295967 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Aug 02, 2019 at 06:38:46PM -0400, Stephen Frost wrote: >Greetings, > >On Fri, Aug 2, 2019 at 18:27 Tom Lane wrote: > >> Tomas Vondra writes: >> > 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. >> >> Yeah. I doubt pg_basebackup is the only actor that can create such >> situations. >> >> > 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. >> >> +1 > > >I disagree that this should only be addressed in alter system, as I’ve said >before and as others have agreed with. Having one set of code that can be >used to update parameters in the auto.conf and then have that be used by >pg_basebackup, alter system, and external tools, is the right approach. > >The idea that alter system should be the only thing that doesn’t just >append changes to the file is just going to lead to confusion and bugs down >the road. > I don't remember any suggestions ALTER SYSTEM should be the only thing that can rewrite the config file, but maybe it's buried somewhere in the thread history. The current proposal certainly does not prohibit any external tool from doing so, it just says we should expect duplicates. >As I said before, an alternative could be to make alter system simply >always append and declare that to be the way to update parameters in the >auto.conf. > That just seems strange, TBH. >> 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? >> >> Personally I agree that warnings are unnecessary. > > >And at least Magnus and I disagree with that, as I recall from this >thread. Let’s have a clean and clear way to modify the auto.conf and have >everything that touches the file update it in a consistent way. > Well, I personally don't feel very strongly about it. I think the warnings will be a nuisance bothering people with expeced stuff, but I'm not willing to fight against it. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services