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 1huWhd-0006VW-TR for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Aug 2019 06:42:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1huWhc-0005m3-IJ for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Aug 2019 06:42:40 +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 1huWhc-0005i3-2e for pgsql-hackers@lists.postgresql.org; Mon, 05 Aug 2019 06:42:40 +0000 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1huWhY-0002EC-J9 for pgsql-hackers@postgresql.org; Mon, 05 Aug 2019 06:42:39 +0000 Received: by mail-pl1-x642.google.com with SMTP id b7so36115796pls.6 for ; Sun, 04 Aug 2019 23:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=q9O/8/LyHNUDzJWCucOqroZhrpu+rlZnnWLAWbtdsqc=; b=EHkjnWBC2+H35lrYa1STJM49UtzXWD/Xf6vohd89gykKbYTilxUCDVUYek6dFp1Tet OZcCGdftgk/oRHk9zIRAbQKGuI3kX84fNMmDpEGjcS/u7oR3WkigZiVosS1WsLswQ0TM ZWtLFjBUIGssWM7xeBUq4giW8EDASfNehEeruAwhxPsZ6T/OyTOUB+R+dSThQHEx7PYt 5g9FPI0l+7Osh6R8I43nx8tRIhtDP4W/LWKl9skzHN/WuKh2hms4WiM3gC3JYrM0SNnp NbL7LJSTULT3f8ybZNSKwSY2SCNAyUcMZ5mlHPOJ3VsDJlduCdd0XhGY+VHnzc7zE3Dt WGVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=q9O/8/LyHNUDzJWCucOqroZhrpu+rlZnnWLAWbtdsqc=; b=rgLtCto4dzOQW93YSOvfrs5d+ze/EaR1A+tCqBSMTiAjeQNm3V4tQ307y0yIX+JJUn 09eHI89G/2+0i4jvOqonFhXZoPGonb9G8I6w6KOemZFP+cuUhuwRJsJD2GSuwblmI6gJ o8IlASpf3/XIOHY3Dne4+m3JDVwSRRZQqf23pz/pQqgI4qNFyzAvQXhho481af40teKR qQr6ScmmsnGcWM89jPhB2WFaOM4eFDvAGM+zzW77EgGapNIRD9Zrbgx4b5Kr1QF0qGdN VS5eMzUfOPItaygBVGb0ODC3HOB0wmGW9FnJRA3vEwYrKkVLZv8E54HZTF8YlDV1tFE4 +Uiw== X-Gm-Message-State: APjAAAWDhuAdwrC85SzfYPI1NwVv1ScvzwOofzCyt6s1Bb1ZBFaduzx3 I4mGf8qUjFMf6Ak7F7js5xSNq0AbmXR333Ki9wOdyfVx5KnGdPQKvWC1KpQZauG2OxrIaWyOU39 54I3IzzloOFYqlop8mad0TzNfY/IUDuqtpz2Qd4hWUGweKxk8OVoMxlxmdRMwzSiQzcxq31MyXm 0cofC21IsWgg3f X-Google-Smtp-Source: APXvYqyNGEpVHrHeMatf3/5O9oKRVkX4GdtNBbDcV4K89mwlmhRuR1/mRgH+o6dXSAT93q0Q/c/m9w== X-Received: by 2002:a17:902:9a85:: with SMTP id w5mr142905860plp.221.1564987354131; Sun, 04 Aug 2019 23:42:34 -0700 (PDT) Received: from osaka.octopusnet (p8460114-ipngn40401marunouchi.tokyo.ocn.ne.jp. [180.57.170.114]) by smtp.gmail.com with ESMTPSA id n128sm38455956pfn.46.2019.08.04.23.42.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 04 Aug 2019 23:42:33 -0700 (PDT) Subject: Re: [PATCH] Stop ALTER SYSTEM from making bad assumptions To: Tom Lane Cc: Tomas Vondra , Amit Kapila , Stephen Frost , Robert Haas , "pgsql-hackers@postgresql.org" 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> <20190802222254.qsvqjtkwte464lu3@development> <31697.1564784856@sss.pgh.pa.us> <16337.1564859628@sss.pgh.pa.us> From: Ian Barwick Message-ID: Date: Mon, 5 Aug 2019 15:42:30 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <16337.1564859628@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 8/4/19 4:13 AM, Tom Lane wrote: > Ian Barwick writes: >> On 8/3/19 7:27 AM, Tom Lane wrote: >>> Tomas Vondra writes: >>>> The main issue however is that no code was written yet. > >>> Seems like it ought to be relatively simple ... but I didn't look. > >> The patch I originally sent does exactly this. > > Ah, you did send a patch, but that tries to maintain the existing behavior > of replacing the last occurrence in-place. I think it's simpler and more > sensible to just make a sweep to delete all matches, and then append the > new setting (if any) at the end, as attached. Yes, that is less convoluted. > A more aggressive patch would try to de-duplicate the entire list, not > just the current target entry ... but I'm not really excited about doing > that in a back-patchable bug fix. I thought about doing that but it's more of a nice-to-have and not essential to fix the issue, as any other duplicate entries will get removed the next time ALTER SYSTEM is run on the entry in question. Maybe as part of a future improvement. > I looked at the TAP test you proposed and couldn't quite convince myself > that it was worth the trouble. A new test within an existing suite > would likely be fine, but a whole new src/test/ subdirectory just for > pg.auto.conf seems a bit much. (Note that the buildfarm and possibly > the MSVC scripts would have to be taught about each such subdirectory.) Didn't know that, but couldn't find anywhere obvious to put the test. > At the same time, we lack any better place to put such a test :-(. > Maybe it's time for a "miscellaneous TAP tests" subdirectory? Sounds reasonable. Regards Ian Barwick -- Ian Barwick https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services