Re: Proposal: Conflict log history table for Logical Replication

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Cc: shveta malik <shveta(dot)malik(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, saurabh singh <saurabh(dot)singh214(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Proposal: Conflict log history table for Logical Replication
Date: 2026-08-26 13:34:07
Message-ID: CALDaNm1P9r3ECe3LROshBUFewdByNpPzDVcm7Avrr+Y+XXAPGw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 26 Aug 2026 at 18:26, Dilip Kumar <dilipbalaut(at)gmail(dot)com> wrote:
>
> I didn’t check the script but if publisher has set the RI full then isn’t we should say RI is full, publisher is the one defining what should be RI am I missing something?

I don't think this is necessarily true. The publisher's replica
identity determines the identity information sent in the logical
change, whereas the conflict log records the local relation's replica
identity on the subscriber.
For example, both publisher tables can have RI full:
CREATE TABLE tab1 (a int, b text);
ALTER TABLE tab1 REPLICA IDENTITY FULL;
CREATE TABLE tab2 (a int, b text);
ALTER TABLE tab2 REPLICA IDENTITY FULL;

But on the subscriber, one table has primary key and another table has RI full:
CREATE TABLE tab1 (a int PRIMARY KEY, b text);
CREATE TABLE tab2 (a int, b text);
ALTER TABLE tab2 REPLICA IDENTITY FULL;

Generate update_origin_differs conflict for both the tables.

The conflict log then shows:
relname | replica_identity_full
---------+-----------------------
tab1 | f
tab2 | t

If replica_identity_full represented the publisher's RI, both would be
true. The different values show that it represents the subscriber's
local RI.

Regards,
Vignesh

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Михаил Купцов 2026-08-26 13:40:51 Re: Changing client-side behavior regarding Certificate Revocation Lists (CRL)
Previous Message Amit Langote 2026-08-26 13:25:00 Re: PG19 FK fast path: OOB write and missed FK checks during batched