Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nX9fx-0006ZN-Ut for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Mar 2022 22:41:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nX9fw-0002NH-Bh for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Mar 2022 22:41:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nX9fw-0002N8-2B for pgsql-hackers@lists.postgresql.org; Wed, 23 Mar 2022 22:41:56 +0000 Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nX9fs-0006X5-KP for pgsql-hackers@postgresql.org; Wed, 23 Mar 2022 22:41:54 +0000 Received: by mail-ej1-x634.google.com with SMTP id o10so5757704ejd.1 for ; Wed, 23 Mar 2022 15:41:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=2L6Qiu/qgkoFOlokvVvdGS2HCsPFZ8A0m416LZ/hypQ=; b=BGg6+IU6JxUcBR3uhVkVCCI3fO/skWcVVfxQA7BZuYkvJ3VM30cAxAwzD1CsTQfkBx 5Br0PHCCEVrnx59b+qIbGrOWHrCyr+xeMJf4SC7+gJxoEze9d7bI5y25J22jQg5Na59t f80G5LfeRX/YL6cHAi4C7iR2L+J5SW5Nlc81FvDadPo08j5/j5UtZmmSqvjplehUfhEb 99lO0HAuI51eqvQp3U+g/IJQ0cpmYhjn7TeoCqWxPrSnTy8//FK8tzGs1wgmlF22ItoI LDpUoP3P29SyQhbwkQVP5I+siOXIOQ8IU+FT05NWMdrItDT29xm2pvIRmSVVAbndPPP7 Sasw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=2L6Qiu/qgkoFOlokvVvdGS2HCsPFZ8A0m416LZ/hypQ=; b=E1c1TiYY7RWaOrEy2qPvw/AJfoXce7j9Qh7NbxZRf+lLjB6RDthW0hBv/umUIO/HBc iwlUNAxVuC9IwLIFmfswsqle2+nDWDnKj0Er40ifXbY8XUBp4wv+/nsY4fmNxyQIBP1H 85suKgbUXJ54nDxeATqvkEzgnFDDQPuz0Ff+XQsbU3E5KqeZgG5aBTRGFWxXMfI3PSr/ dqNppkrD+iNe7iCTCUkL59BhuzrMDKuDnw/t69e36eZrHxqBj5feNLEoTgJldBRjgzyO XuJi22gXpb1yYh2utecIt7vKrKS4pP+m6vTBgSmDdvgq2EAFDzLGCpSCW/rPR6mlSrC1 nTDQ== X-Gm-Message-State: AOAM532LN6aAFTg9Ka6dQyY16rNs4sDDiejnGH/znBOISfNOYEtPl30n Sqs5Sjfi5B1SSM9582pbJgwjfozqmzTBui6kkzm4F11xesOxTx1EANrpjzJOx/riPz/rKVcdWtD clEbYgsLH5b9jmlwpQ2ymWtpO3vLurG5otC8XQltUZHL4J/vlcXdk28iJx3T587HhU6CULo1Qlh W7yY6FBWy4zirRdXfI0K00NueSPYcBy9IAUSz9 X-Google-Smtp-Source: ABdhPJziAxL8Z9tJkbWePaIsclUh+4YtKzcZmKBn/CMDvmIKkfo1YhuJTxlcfrSclGOk9Lb1CNKzKg== X-Received: by 2002:a17:907:2cc6:b0:6e0:3113:6e9a with SMTP id hg6-20020a1709072cc600b006e031136e9amr2621561ejc.519.1648075310600; Wed, 23 Mar 2022 15:41:50 -0700 (PDT) Received: from [10.137.0.17] (ip-86-49-251-241.net.upcbroadband.cz. [86.49.251.241]) by smtp.gmail.com with ESMTPSA id cn27-20020a0564020cbb00b00418b0c7fbbfsm548612edb.32.2022.03.23.15.41.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Mar 2022 15:41:50 -0700 (PDT) Message-ID: Date: Wed, 23 Mar 2022 23:41:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: Column Filtering in Logical Replication Content-Language: en-US To: Amit Kapila Cc: "houzj.fnst@fujitsu.com" , Peter Eisentraut , Alvaro Herrera , Justin Pryzby , Rahila Syed , Peter Smith , pgsql-hackers , "shiy.fnst@fujitsu.com" References: <202201120041.p24wvsfcsope@alvherre.pgsql> <78b8d385-57cb-9a3f-cfe5-9f300f15eced@enterprisedb.com> <822a8e40-287c-59ff-0ea9-35eb759f4fe6@enterprisedb.com> <2b8471f9-3849-c91f-ef82-9181d4bca0a7@enterprisedb.com> <16e83ce3-8415-b732-37b2-c3329a2c13a1@enterprisedb.com> <3162f7f0-86ac-e3a9-dc55-0a660cb9bab1@enterprisedb.com> From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 3/21/22 12:28, Amit Kapila wrote: > On Fri, Mar 18, 2022 at 8:13 PM Tomas Vondra > wrote: >> >> Ah, thanks for reminding me - it's hard to keep track of all the issues >> in threads as long as this one. >> >> BTW do you have any opinion on the SET COLUMNS syntax? Peter Smith >> proposed to get rid of it in [1] but I'm not sure that's a good idea. >> Because if we ditch it, then removing the column list would look like this: >> >> ALTER PUBLICATION pub ALTER TABLE tab; >> >> And if we happen to add other per-table options, this would become >> pretty ambiguous. >> >> Actually, do we even want to allow resetting column lists like this? We >> don't allow this for row filters, so if you want to change a row filter >> you have to re-add the table, right? >> > > We can use syntax like: "alter publication pub1 set table t1 where (c2 >> 10);" to reset the existing row filter. It seems similar thing works > for column list as well ("alter publication pub1 set table t1 (c2) > where (c2 > 10)"). If I am not missing anything, I don't think we need > additional Alter Table syntax. > >> So maybe we should just ditch ALTER >> TABLE entirely. >> > > Yeah, I agree especially if my above understanding is correct. > I think there's a gotcha that ALTER PUBLICATION pub SET TABLE t ... also removes all other relations from the publication, and it removes and re-adds the table anyway. So I'm not sure what's the advantage? Anyway, I don't see why we would need such ALTER TABLE only for column filters and not for row filters - either we need to allow this for both options or none of them. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company