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 1msENk-00032T-Ab for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Dec 2021 01:26:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1msENh-0004te-LR for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Dec 2021 01:25:57 +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 1msENg-0004tV-Hg for pgsql-hackers@lists.postgresql.org; Wed, 01 Dec 2021 01:25:57 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1msENd-0004Ey-7u for pgsql-hackers@lists.postgresql.org; Wed, 01 Dec 2021 01:25:55 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id DAE18580317; Tue, 30 Nov 2021 20:25:51 -0500 (EST) Received: from imap49 ([10.202.2.99]) by compute5.internal (MEProxy); Tue, 30 Nov 2021 20:25:51 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm3; bh=Lw0/6A78/02bB8UxqpId7uQNtfK7uxW wuxer7YUFcuE=; b=OKbPfogtll6Hm2z2XlHNK54LNGN1D6vsHhmXx/4kpXbOJJe VxSaDN6EQs09/Zhb9KKn+RLg3iSvtbArG09YshudN0IbkUwpdpQ15luoWvSMCGAB 2xmpJ9vNUUyDo+PwjCrJmf4mEl3LwrJaTti4LmTZLj2RUpKarkWl91AZUFQtfsgF QmTADWxxOvpsF5JxcK/87prMzvNmeDowvWP9hBZkRYHvrqgr4aj9T9+A8w41vFjS a24QWLKfL3jtsWpJp1qRwzD49wgj+juvH1vHn0psd5xx6NO+nmvwBeJ9M1n2MncE 2+f3ruHcMhYt7MoL0npi/v1vqqSSHrDaNfWyOyA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Lw0/6A 78/02bB8UxqpId7uQNtfK7uxWwuxer7YUFcuE=; b=DKgysWVQLLLTRScxjFeQtB QSh4zesXha2/RB+ain9YFggMTlHU7C9M2n/o81YVk53lEI06l5AL3XMtYSHHIjep f2T6f6szYsEa4pNQ4DSSvGZV8rq1e8FCZLLsKjzxlH5XbSwdzIkJB4yNOn0lWf+Z /exGqVlsrlK3oSmkE90WFbfmj8XeYyDvTZ5q2aY3sHbriaMMEm29Ryxak9lw8OZS A7ckr3fvOQhfydJjfCqWHqhvRmRe501CDOJ5jz1HlNiawQywnaqhjHLffzxzxB7z 6aeaKwPdfwST14XUQnfUe2WdbgY0P6DLYG9BOSXE2WPdlbfipIN0mNOd4bVDAHoQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddriedvgdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtsegrtderreerredtnecuhfhrohhmpedfgfhulhgv rhcuvfgrvhgvihhrrgdfuceovghulhgvrhesvghulhgvrhhtohdrtghomheqnecuggftrf grthhtvghrnhepjeethfeuvdfgffdtteevudeftdejueffkeelveekhfevkeegleefhfej hedtjeegnecuffhomhgrihhnpegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhush htvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegvuhhlvghrsegvuhhl vghrthhordgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 0A02BF6006E; Tue, 30 Nov 2021 20:25:51 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4410-g5528bb82a8-fm-20211130.003-g5528bb82 Mime-Version: 1.0 Message-Id: <7ad38afd-eb5b-47b7-8d1c-49a7b2637367@www.fastmail.com> In-Reply-To: References: Date: Tue, 30 Nov 2021 22:25:08 -0300 From: "Euler Taveira" To: "Amit Kapila" , "Dilip Kumar" Cc: "Greg Nancarrow" , "houzj.fnst@fujitsu.com" , "vignesh C" , "Peter Smith" , "tanghy.fnst@fujitsu.com" , "Ajin Cherian" , "Rahila Syed" , "Peter Eisentraut" , =?UTF-8?Q?=C3=96nder_Kalac=C4=B1?= , japin , "Michael Paquier" , "David Steele" , "Craig Ringer" , "Amit Langote" , "PostgreSQL Hackers" Subject: Re: row filtering for logical replication Content-Type: multipart/alternative; boundary=7e10052d9253410e8c63a2e37b9f0fa5 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --7e10052d9253410e8c63a2e37b9f0fa5 Content-Type: text/plain On Tue, Nov 30, 2021, at 7:25 AM, Amit Kapila wrote: > On Tue, Nov 30, 2021 at 11:37 AM Dilip Kumar wrote: > > > > What about the initial table sync? during that, we are going to > > combine all the filters or we are going to apply only the insert > > filters? > > > > AFAIK, currently, initial table sync doesn't respect publication > actions so it should combine all the filters. What do you think? I agree. If you think that it might need a row to apply DML commands (UPDATE, DELETE) in the future or that due to a row filter that row should be available in the subscriber (INSERT-only case), it makes sense to send all rows that satisfies any row filter. The current code already works this way. All row filter are combined into a WHERE clause using OR. If any of the publications don't have a row filter, there is no WHERE clause. -- Euler Taveira EDB https://www.enterprisedb.com/ --7e10052d9253410e8c63a2e37b9f0fa5 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Tue, Nov 30,= 2021, at 7:25 AM, Amit Kapila wrote:
On Tue, Nov 30, 2021 at 11:37 AM Dilip Kumar = <dilipbalaut@gmail.com&g= t; wrote:
>
> What about the initial t= able sync? during that, we are going to
> combine all t= he filters or we are going to apply only the insert
> f= ilters?
>

AFAIK, currently= , initial table sync doesn't respect publication
actions s= o it should combine all the filters. What do you think?
I agree. If you think that it might need a row to apply DML c= ommands (UPDATE,
DELETE) in the future or that due to a ro= w filter that row should be available
in the subscriber (I= NSERT-only case), it makes sense to send all rows that
sat= isfies any row filter.

The current code alr= eady works this way. All row filter are combined into a
WH= ERE clause using OR. If any of the publications don't have a row filter,=
there is no WHERE clause.

--
Euler Taveira

--7e10052d9253410e8c63a2e37b9f0fa5--