Re: Proposal: Conflict log history table for Logical Replication

From: vignesh C <vignesh21(at)gmail(dot)com>
To: shveta malik <shveta(dot)malik(at)gmail(dot)com>
Cc: Zhijie Hou <houzhijie22(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, shihao zhong <zhong950419(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, saurabh singh <saurabh(dot)singh214(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, shveta malik <shvetamalik(at)gmail(dot)com>
Subject: Re: Proposal: Conflict log history table for Logical Replication
Date: 2026-11-10 09:08:56
Message-ID: CALDaNm1MGj6ADB6=mFyAqJBKDSF_akXKhgm03=h4m7htOH9iCA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 5 Nov 2026 at 14:24, shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
>
> I am not sure if you have started taking comments on 002 yet. Here are
> a few comments; feel free to defer them to later versions if we want
> to conclude on 001 first.
>
> 1)
> CONFLICT_LOG_RELATION_NAME_FMT is only used in backend code
> (conflict.c and subscriptioncmds.c), so I think it need not be inside
> the '#ifdef EXPOSE_TO_CLIENT_CODE'?
>
>
> 2)
> + if (dopt->binary_upgrade)
> + tbinfo->dobj.dump = DUMP_COMPONENT_DEFINITION | DUMP_COMPONENT_ACL;
> + else
> + tbinfo->dobj.dump = DUMP_COMPONENT_NONE;
>
> In a regular (non-binary-upgrade) dump, we do not dump definition of
> CLT (which is fine) as the table gets created if needed on dumped
> 'ALTER SUB' but we do not even dump privileges granted on it (because
> the name of CLT is not known). So post-upgrade user has to execute
> GRANTs etc again (if any). I think it would be worth documenting this
> limitation in the pg_dump doc, alongside the existing information
> about subscriptions.
>
> 3)
> dumpTableSchema:
> + bool conflict_log_table =
> + (strcmp(tbinfo->dobj.namespace->dobj.name, "pg_conflict") == 0);
>
> selectDumpableNamespace:
> + if (strcmp(tbinfo->dobj.namespace->dobj.name, "pg_conflict") == 0)
>
> Should we make a function for this usage:
>
> static bool
> is_conflict_log_table(const TableInfo *tbinfo)
> {
> return strcmp(tbinfo->dobj.namespace->dobj.name, "pg_conflict") == 0;
> }

Thanks for the comments, these comments are addressed in the v93
version patch attached. Apart from these there were a couple of
additional comments of Hou-san addressed which he shared with me
offlist, thanks Hou-san for that. There is no change in 0001 patch, it
is the same as the v92 version patch.

Regards,
Vignesh

Attachment Content-Type Size
v93-0001-Record-logical-replication-conflicts-in-the-conf.patch application/octet-stream 138.5 KB
v93-0003-Add-conflict-log-table-information-to-describe.patch application/octet-stream 80.3 KB
v93-0002-Preserve-conflict-log-destination-and-subscripti.patch application/octet-stream 23.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhijie Hou 2026-11-10 09:17:57 Re: Assertion failure in update_local_synced_slot(), slotsync.c:364
Previous Message Chao Li 2026-11-10 08:49:33 Re: [PATCH] Fix two client-side NULL dereferences on malformed result sets (libpq, pg_receivewal)