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 1n5SZV-0001kM-Rg for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Jan 2022 13:12:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n5SZS-0002L9-RN for pgsql-hackers@arkaria.postgresql.org; Thu, 06 Jan 2022 13:12:46 +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 1n5SZR-0002Ir-Py for pgsql-hackers@lists.postgresql.org; Thu, 06 Jan 2022 13:12:46 +0000 Received: from new3-smtp.messagingengine.com ([66.111.4.229]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n5SZM-0003F4-Lz for pgsql-hackers@lists.postgresql.org; Thu, 06 Jan 2022 13:12:44 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 69BF45802F5; Thu, 6 Jan 2022 08:12:39 -0500 (EST) Received: from imap49 ([10.202.2.99]) by compute5.internal (MEProxy); Thu, 06 Jan 2022 08:12:39 -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=R+matAAOfF7W77Fb4s6FW1iBBeMius6 KZCaMVJTAkks=; b=Qw4TJR6bxzJ2ByAT+bmWdGV4LB6tXK9abH0XoCEYQXhLdbR YyfJFZhWO1Rnjh274wPbYBdVlvi+WuIdNkGkPdGWaNdWEiW4JA7cJbZlP2o2HhHu qOVselo7VGDuHRtd1cfhO8u2WZFE9ybUA5tsklCoY/THqceggn5lWCkCQMTQQKOo 6f7yxsvYou1BLwvLJ69lSgmVsJVomVlnftesvsgP9dFVyvjtuPEl+zagNjEk8WJF HI/MBc0brRdQqJqP5okthUVvE6LtHqYdo6Ug2a0Faex3LyTBMr9iJs9sTWNaboeU GEeF6KJUHpsnWKGyEx71DvlqLtySMoK92N6+mtg== 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=R+matA AOfF7W77Fb4s6FW1iBBeMius6KZCaMVJTAkks=; b=j6BFsunvUXiX/NYGsDR4Sm 279A9Lx0XnotuGFM3g/KX/aGc6ZxtPzacVqXQhB0ISJghOGv3GLwRdWsMohYzMYE mNczpnsPO0MF3lqqmT93tOvzdWOTGOu4DDLbWDgsdQDPD+U6r7ATQcFquw3FuXXk LmsOL+dZKB5yZj8PD/gf6x1SeaBPJVEKZC2OsziH3xF0XVr0Xo1gSQHmoDOWdRMa XbNTAmyCwAOrgzBxZbP9bVYrkg1F9YT9dj+SmAS3EUle7slFpQU8w1j9jSnRxd7S Bhl7smSvxDuAY47YQ++h2TSbh1vHacS7oi3FiM2f1+My5Ai9D9pRBwUgAcbPaB3g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefledggeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesrgdtreerreertdenucfhrhhomhepfdfguhhl vghrucfvrghvvghirhgrfdcuoegvuhhlvghrsegvuhhlvghrthhordgtohhmqeenucggtf frrghtthgvrhhnpeejtefhuedvgffftdetvedufedtjeeuffekleevkefhveekgeelfefh jeehtdejgeenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluh hsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepvghulhgvrhesvghu lhgvrhhtohdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 8A518F60080; Thu, 6 Jan 2022 08:12:38 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4526-gbc24f4957e-fm-20220105.001-gbc24f495 Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Thu, 06 Jan 2022 10:11:56 -0300 From: "Euler Taveira" To: "Amit Kapila" , "Peter Smith" Cc: "houzj.fnst@fujitsu.com" , "Greg Nancarrow" , "vignesh C" , "Ajin Cherian" , "tanghy.fnst@fujitsu.com" , "Dilip Kumar" , "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=9419105c109443bcb0c2a03f0e76a8ba List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --9419105c109443bcb0c2a03f0e76a8ba Content-Type: text/plain On Thu, Jan 6, 2022, at 1:18 AM, Amit Kapila wrote: > On Thu, Jan 6, 2022 at 8:43 AM Peter Smith wrote: > > > > On Wed, Jan 5, 2022 at 9:52 PM Amit Kapila wrote: > > > > > ... > > > > > Another minor comment: > > > +static bool pgoutput_row_filter(enum ReorderBufferChangeType changetype, > > > > > > Do we need to specify the 'enum' type before changetype parameter? > > > > > > > That is because there is currently no typedef for the enum > > ReorderBufferChangeType. > > > > But I see that the 0002 patch is already adding the required typedef. IMO we shouldn't reuse ReorderBufferChangeType. For a long-term solution, it is fragile. ReorderBufferChangeType has values that do not matter for row filter and it relies on the fact that REORDER_BUFFER_CHANGE_INSERT, REORDER_BUFFER_CHANGE_UPDATE and REORDER_BUFFER_CHANGE_DELETE are the first 3 values from the enum, otherwise, it breaks rfnodes and no_filters in pgoutput_row_filter(). I suggest a separate enum that contains only these 3 values. enum RowFilterPublishAction { PUBLISH_ACTION_INSERT, PUBLISH_ACTION_UPDATE, PUBLISH_ACTION_DELETE }; -- Euler Taveira EDB https://www.enterprisedb.com/ --9419105c109443bcb0c2a03f0e76a8ba Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Thu, Jan 6, = 2022, at 1:18 AM, Amit Kapila wrote:
On Thu, Jan 6, 2022 at 8:43 AM Peter Smith <= ;smithpb2250@gmail.com> = wrote:
>
> On Wed, Jan 5, 2022 at 9:52= PM Amit Kapila <amit.kapi= la16@gmail.com> wrote:
> >
>= ...
>
> > Another minor comment:
> > +static bool pgoutput_row_filter(enum ReorderBuff= erChangeType changetype,
> >
> >= Do we need to specify the 'enum' type before changetype parameter?
<= /div>
> >
>
> That is becaus= e there is currently no typedef for the enum
> ReorderB= ufferChangeType.
>

But I s= ee that the 0002 patch is already adding the required typedef.
=
IMO we shouldn't reuse ReorderBufferChangeType. For a = long-term solution, it is
fragile. ReorderBufferChangeType= has values that do not matter for row filter
and it relie= s on the fact that REORDER_BUFFER_CHANGE_INSERT,
REORDER_B= UFFER_CHANGE_UPDATE and REORDER_BUFFER_CHANGE_DELETE are the first 3
=
values from the enum, otherwise, it breaks rfnodes and no_fil= ters in
pgoutput_row_filter(). I suggest a separate enum t= hat contains only these 3
values.

=
enum RowFilterPublishAction {
   PUBLISH_AC= TION_INSERT,
   PUBLISH_ACTION_UPDATE,
=
   PUBLISH_ACTION_DELETE
};
<= br>

--
Euler Taveira

= --9419105c109443bcb0c2a03f0e76a8ba--