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 1mLRhz-0003gl-RT for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Sep 2021 14:59:24 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mLRhx-0001Dj-GG for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Sep 2021 14:59:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLRhw-0001B1-4K for pgsql-hackers@lists.postgresql.org; Wed, 01 Sep 2021 14:59:21 +0000 Received: from new2-smtp.messagingengine.com ([66.111.4.224]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLRhq-0002Tl-Lp for pgsql-hackers@lists.postgresql.org; Wed, 01 Sep 2021 14:59:19 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailnew.nyi.internal (Postfix) with ESMTP id 97C0D580D50; Wed, 1 Sep 2021 10:59:12 -0400 (EDT) Received: from imap21 ([10.202.2.71]) by compute1.internal (MEProxy); Wed, 01 Sep 2021 10:59:12 -0400 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=fm2; bh=Zn8N2dHHntqXrMp1th7buEfNOZKK9/E Y+K1DoSZK1CU=; b=SfjvF7g/NGOLiiXqE3haFakR2YpILFsLh5Wmn9jdcvNfOP0 k1lTwS9DwcKlRbH3DogRsQSHhmX63ociPyw1rBtBzFvP1zEBgmKevPjx1ORYSc9b BkQ0o3TeuXSCisT1cuwO2WcrC7aI2XMj3PSItQbkqUbQqaMhESz7fIpQSE4EECEo lTZDedr8itJs00YzS8nH/m4ByS8DW52jGWHABqNYNHoOubS+7HHRQFhK2mzY1dfw A/OjkaTj1XIp46lpXQJwxv6eE9VXx8TO7bp2AoJiz9X0KLj+UmC5uWP8X+1qRVbI Vya22IPJvfny3RGP1uZtJn4BD7BwmF46CwHizFA== 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=fm3; bh=Zn8N2d HHntqXrMp1th7buEfNOZKK9/EY+K1DoSZK1CU=; b=awJDk5+RI4qYbrZvD7FYTq zcyRjqZ/0hznqZpoxCznnFw6UZ9lr4047gyUTUgAkmRmYHltmIf3k7AVa7pD5JYx XNxGL9ke1ttSLcTDlez0Lm/RS7Tbnm8zkLjiUfwcqg7c5G4SKAWRmsJOUvNbuy/T DTVG9Xr126NUJ8xsiwO+G2RW/VQc4SoZaNZoWTjkEwR9o30KGxmrmrSvr+A/L5Do vlCPbJPZtCjeIJbCCGdfANOAg/Ast6+MUWSt7XYKrQEHEA5glAKDsb1nuwFMHJn3 Q3mUB/rHCy+sg1NE76T4TT5aTHJIdDvjkQZ0IkimGgjHH4zvdnYyu0Jw0T3PgL0g == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvfedgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesrgdtreerreertdenucfhrhhomhepfdfguhhl vghrucfvrghvvghirhgrfdcuoegvuhhlvghrsegvuhhlvghrthhordgtohhmqeenucggtf frrghtthgvrhhnpeekgeefhefhudeftdefjeekveevvdfhjeejgffhgeeitdejfedttdet feeljeelgeenucffohhmrghinhepghhithhhuhgsrdgtohhmpdhpohhsthhgrhgvshhqlh drohhrghdpvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepvghulhgvrhesvghulhgvrhhtohdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id E546951C0060; Wed, 1 Sep 2021 10:59:10 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-1126-g6962059b07-fm-20210901.001-g6962059b Mime-Version: 1.0 Message-Id: <43d30940-eb95-4c98-aa60-5e0a50ec9993@www.fastmail.com> In-Reply-To: References: <8cf1ea71-b609-00e8-b8f0-c85ba61b7312@pgmasters.net> <4dbad191-9b40-4bb6-8940-d18f2e93c3ce@www.fastmail.com> <5b9fceed-8f91-467f-a64e-2134c5c3f496@www.fastmail.com> <52edc9d2-8e52-4cde-9a15-991961b78387@www.fastmail.com> <9d5ef845-391a-4c66-b298-0f594d9e6828@www.fastmail.com> <7e4b5c48-a3d3-4b7e-b455-2d50c60a0ab7@www.fastmail.com> <57373e8b-1264-cd37-404e-8edbcf7884cc@enterprisedb.com> <86d76e89-9a96-411a-8077-f8918cbae2e1@www.fastmail.com> <3dbf7241-a417-45c9-9a0e-04a079de9b9f@www.fastmail.com> <0ca5b27f-edf8-4ef9-a9e2-533216890f62@www.fastmail.com> <532a18d8-ce90-4444-8570-8a9fcf09f329@www.fastmail.com> <0c2464d4-65f4-4d91-aeb2-c5584c1350f5@www.fastmail.com> Date: Wed, 01 Sep 2021 11:58:50 -0300 From: "Euler Taveira" To: "Amit Kapila" Cc: "Peter Smith" , "Rahila Syed" , "Peter Eisentraut" , =?UTF-8?Q?=C3=96nder_Kalac=C4=B1?= , japin , "Michael Paquier" , "David Steele" , "Craig Ringer" , "Tomas Vondra" , "Amit Langote" , "PostgreSQL Hackers" Subject: Re: row filtering for logical replication Content-Type: multipart/alternative; boundary=e7a80e8a9b29487189b6988c83823991 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --e7a80e8a9b29487189b6988c83823991 Content-Type: text/plain On Wed, Sep 1, 2021, at 9:36 AM, Amit Kapila wrote: > I think this or any other similar solution for row filters (on > updates) won't work till we solve the problem reported by Hou-San [1]. > The main reason is that we don't have data for unchanged toast columns > in WAL. For that, we have discussed some probable solutions in email > [2], however, that also required us to solve one of the existing > bugs[3]. I didn't mention but I'm working on it in parallel. I agree with you that including TOAST values in the WAL is a possible solution for this issue. This is a popular request for wal2json [1][2][3] and I think other output plugins have the same request too. It is useful for CDC solutions. I'm experimenting 2 approaches: (i) always include unchanged TOAST values to new tuple if a GUC is set and (ii) include unchanged TOAST values to new tuple iif it wasn't include in the old tuple. The advantage of the first option is that you fix the problem adjusting a parameter in your configuration file. However, the disadvantage is that, depending on your setup -- REPLICA IDENTITY FULL, you might have the same TOAST value for a single change twice in the WAL. The second option solves the disadvantage of (i) but it only works if you have REPLICA IDENTITY FULL and Dilip's patch applied [4] (I expect to review it soon). In the output plugin, (i) requires a simple modification (remove restriction for unchanged TOAST values) but (ii) needs a more complex surgery. [1] https://github.com/eulerto/wal2json/issues/205 [2] https://github.com/eulerto/wal2json/issues/132 [3] https://github.com/eulerto/wal2json/issues/42 [4] https://www.postgresql.org/message-id/CAFiTN-uW50w0tWoUBg_VYCdvNeCzT%3Dt%3DJzhmiFd452FrLOwMMQ%40mail.gmail.com -- Euler Taveira EDB https://www.enterprisedb.com/ --e7a80e8a9b29487189b6988c83823991 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Wed, Sep 1, = 2021, at 9:36 AM, Amit Kapila wrote:
I think this or any other similar solution for= row filters (on
updates) won't work till we solve the pro= blem reported by Hou-San [1].
The main reason is that we d= on't have data for unchanged toast columns
in WAL. For tha= t, we have discussed some probable solutions in email
[2],= however, that also required us to solve one of the existing
bugs[3].
I didn't mention but I'm working = on it in parallel.

I agree with you that in= cluding TOAST values in the WAL is a possible solution
for= this issue. This is a popular request for wal2json [1][2][3] and I thin= k
other output plugins have the same request too. It is us= eful for CDC solutions.

I'm experimenting 2= approaches: (i) always include unchanged TOAST values to
= new tuple if a GUC is set and (ii) include unchanged TOAST values to new= tuple
iif it wasn't include in the old tuple. The advanta= ge of the first option is
that you fix the problem adjusti= ng a parameter in your configuration file.
However, the di= sadvantage is that, depending on your setup -- REPLICA IDENTITY
FULL, you might have the same TOAST value for a single change twic= e in the WAL.
The second option solves the disadvantage of= (i) but it only works if you have
REPLICA IDENTITY FULL a= nd Dilip's patch applied [4] (I expect to review it
soon).= In the output plugin, (i) requires a simple modification (remove
restriction for unchanged TOAST values) but (ii) needs a more co= mplex surgery.

[4] https://www.postgresql.= org/message-id/CAFiTN-uW50w0tWoUBg_VYCdvNeCzT%3Dt%3DJzhmiFd452FrLOwMMQ%4= 0mail.gmail.com


--
Eu= ler Taveira

--e7a80e8a9b29487189b6988c83823991--