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 1nK8Mn-0000h1-2l for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Feb 2022 00:40:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nK8MF-0005HP-TI for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Feb 2022 00:39:47 +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 1nK8MF-0005HG-9H for pgsql-hackers@lists.postgresql.org; Wed, 16 Feb 2022 00:39:47 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nK8MA-000120-AC for pgsql-hackers@postgresql.org; Wed, 16 Feb 2022 00:39:45 +0000 Received: by mail-wr1-x42f.google.com with SMTP id q7so715601wrc.13 for ; Tue, 15 Feb 2022 16:39:42 -0800 (PST) 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=txNoVpHoLvdqzvK6Q+iHpk2w2xUz3Ts9diZzWvtWfFc=; b=J7keWtAR9Qp+J0IWdR4vagPbcH/5pA+PuoqaeCpSMVo3m5J4Ck/mlaNc0PupUfspGi BzOCzb7sqhBXDvGz/sdMZa6ZKLlew8xWSsIjEJT39FqlgUXDYKEuJMXI+vnhqertcGQM +bW3EkMijSBMkbkyroHDpY+fi22Jnbx+LNg8ckZoSNAZ/0ZJJ2rlM4Ht/a6+DD3+HWwG tt0QbvvBRUd2ULZIBKJoqK4XVJjVXpp3dH/y5udybAluRuucsSCnNoAfAiRQTL/X56pg ZyTpz0LBqmony7f1BYJxKnwLx9Slj/We8SSgWIcj/I1606CcNuB9fZBIj3GtCqmXpsZv Av8g== 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=txNoVpHoLvdqzvK6Q+iHpk2w2xUz3Ts9diZzWvtWfFc=; b=qScMZlB8aYUAalbLFNdJhbAEBAzOYPBA+AidwD7FpDiLy6V3bTcN8nffAVxoBCbVd5 a/XYKZDvEW6Qr3Kg7r/hi6gFA9izE/NLHQmYDP0KOm3Fa09uINbyzz9QXOORYp1+aobH AxuQwkrOn2qZRggIA7e569bxDLXBXjDXS+/iwp8RsjREl+lG5vxQFBmKhPW/GJBl9lNf QTGo94UQANsJprbQobfb2d5Rv4sZky6t/jMHt6DLbWIer2j0S669DCUhype++1VpiPDC tP4UPXzX/av+lOlJc9iPZ4o+S/yH+zjkp5KsUYbct7hQRKibHXvP1Fs8oRX8W0k7hRl9 CM5w== X-Gm-Message-State: AOAM530RfqMcBNu5314ICw9J0GXQrVNUhe6NWf3XaUkDqRt/41amwhh7 JjT0KUqYPNi0D1hfTVe3Srg/vriDzLDq3J4qaDF/V61owkYRJYaYm/8vyZ230ORUVdhffOKBYG4 76d5YF0AiUUYpzHqBSC+PVF7S5gixqaOH1eOVvs6plddlgH1XswIihyXIS/KYyeB+6dpqccI26L 4BsoXiEcFVkXAcymU9OgImThEe0NwHyC4aA9IK X-Google-Smtp-Source: ABdhPJzrzfxrUcCf8pNrg/6eXcA8if7zwY6i9RPuAGyTsIB/JMSz9duU5YqcTL2O0HtIfwa8Yqy8tA== X-Received: by 2002:adf:e8c5:0:b0:1e4:7c8a:21a7 with SMTP id k5-20020adfe8c5000000b001e47c8a21a7mr352000wrn.516.1644971980803; Tue, 15 Feb 2022 16:39:40 -0800 (PST) Received: from [10.137.0.19] (ip-86-49-251-241.net.upcbroadband.cz. [86.49.251.241]) by smtp.gmail.com with ESMTPSA id bg26sm18314525wmb.48.2022.02.15.16.39.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Feb 2022 16:39:40 -0800 (PST) Message-ID: <8b9860fc-bcd1-e579-a305-76f6f54cc98b@enterprisedb.com> Date: Wed, 16 Feb 2022 01:39:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: Column Filtering in Logical Replication Content-Language: en-US To: Alvaro Herrera Cc: Peter Eisentraut , Justin Pryzby , Amit Kapila , "houzj.fnst@fujitsu.com" , Rahila Syed , Peter Smith , pgsql-hackers@postgresql.org References: <202202160033.suwczmeq7mjf@alvherre.pgsql> From: Tomas Vondra In-Reply-To: <202202160033.suwczmeq7mjf@alvherre.pgsql> 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 2/16/22 01:33, Alvaro Herrera wrote: > On 2022-Feb-16, Tomas Vondra wrote: > >> Here's an updated version of the patch, rebased to current master. Parts >> 0002 and 0003 include various improvements based on review by me and another >> one by Peter Smith [1]. > > Thanks for doing this! > >> 1) partitioning with pubviaroot=true > > I agree that preventing the inconsistencies from happening is probably > the best. > >> 2) merging multiple column filters >> >> When the table has multiple column filters (in different publications), we >> need to merge them. Which works, except that FOR ALL TABLES [IN SCHEMA] >> needs to be handled as "has no column filter" (and replicates everything). > > Agreed. > >> 3) partitioning with pubivaroot=false >> >> When a partitioned table is added with (pubviaroot=false), it should not be >> subject to column filter on the parent relation, which is the same behavior >> used by the row filtering patch. > > You mean each partition should define its own filter, or lack of filter? > That sounds reasonable. > If the partition is not published by the root, it shouldn't use the filter defined on the root. I wonder what should happen to the filter defined on the partition itself. I'd say pubviaroot=false -> use filter defined on partition (if any) pubviaroot=true -> use filter defined on root (if any) I wonder what the row filter patch is doing - we should probably follow the same logic, if only to keep the filtering stuff consistent. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company