RE: Logical replication row filter loses unchanged toasted columns

From: "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com>, Shinya Kato <shinya11(dot)kato(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>
Subject: RE: Logical replication row filter loses unchanged toasted columns
Date: 2026-08-27 02:23:38
Message-ID: TY4PR01MB17718C413D3D39BF057210D9C94AD2@TY4PR01MB17718.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tuesday, August 25, 2026 6:16 PM Kuroda, Hayato <kuroda(dot)hayato(at)fujitsu(dot)com> wrote:
> > Here is the patch (on HEAD) for the suggested approach. I extended
> > extractReplicaIdentity to also extract unchanged toasted columns, as
> > it fits best there, we only need to log unchanged toast columns when
> > the replica identity changes.
>
> Thanks for posting the patch.
> I cannot find any the conceptual issues. I considered the alternative that new
> tuple can have un-changed toasted values, but it seems not good for the crash
> recovery: the code uses the tuple in the WAL as-is, so we should have the
> pointer to the toast table. Few small comments:
>
> ```
> +#include "catalog/pg_publication.h"
> ```
>
> I could compile the code without the inclusion, maybe because we use
> RelationHasPubRowFilterForUpdate() to obtain the rf_exists_for_update.
>
> ```
> + * to protect unchanged, non-replica-identity, TOASTed column
> + values that
> ```
>
> Not sure the term "protect" correct. How about "preserve"? Because we try
> to keep the toast value on the memory in heap_update().

Thanks for the comments. They look good to me and I have addressed them
in V4 patch.

Best Regards,
Zhijie Hou

Attachment Content-Type Size
v4-0001-Log-unchanged-out-of-line-columns-for-row-filtere.patch application/octet-stream 21.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2026-08-27 02:23:39 Re: [PATCH] Refactor parse_publication_options
Previous Message jian he 2026-08-27 01:59:44 Re: Row pattern recognition