Re: Logical replication row filter loses unchanged toasted columns

From: Nikhil Sontakke <nikhil(at)planetscale(dot)com>
To: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Shinya Kato <shinya11(dot)kato(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Logical replication row filter loses unchanged toasted columns
Date: 2026-08-13 07:42:10
Message-ID: CA+UBoq0jv0BafwSFYDd680SxEwGYUTSjrPW0iQyZdqKFfRZokw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Zhijie,

>
> I feel catching such an unchanged toasted column issue during INSERT in the
> apply worker could be better. The apply worker provides native context
> about the
> transaction and the action being replayed, making the error easier to
> diagnose.
> Erroring in the apply worker also gives users more flexibility to resolve
> the
> issue,

This is what I was arriving at myself as well. FWIW, here is a patch
that does precisely that along with test case changes.

I think this should go in now, so that a change which cannot be applied
completely stops being silently turned into a NULL on the subscriber.
For the same reason I think it should be back-patched to 15, which is
where row filters were added and so is the first affected branch.

Any option along the lines of the option B that Shinya-san outlined
changes what the publisher writes to WAL, so for master it will need a
commitfest cycle regardless. I would rather not have the silent data
loss wait for that.

Thanks,
Nikhil
---
Nikhil Sontakke
PlanetScale

Attachment Content-Type Size
0001-Refuse-a-logical-replication-INSERT-that-is-m-master.patch application/octet-stream 10.4 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2026-08-13 07:45:32 Re: Correct some doc items due to the REPACK
Previous Message Daniel Gustafsson 2026-08-13 07:33:41 Re: LibreSSL and OpenSSL separation in libpq to support 1.1.1 deprecation