Re: Proposal: Conflict log history table for Logical Replication - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: Proposal: Conflict log history table for Logical Replication
Date
Msg-id CAA4eK1L-yBio2zbSVsKQ9LCy8orszXviqORHp=sg2jSq=76D2A@mail.gmail.com
Whole thread
In response to Re: Proposal: Conflict log history table for Logical Replication  (Zhijie Hou <houzhijie22@gmail.com>)
Responses Re: Proposal: Conflict log history table for Logical Replication
List pgsql-hackers
On Wed, Oct 7, 2026 at 10:21 PM Zhijie Hou <houzhijie22@gmail.com> wrote:
>
> I've started reviewing the 0001 patch and would like to suggest some refactoring
> to simplify the code in ReportApplyConflict(). The idea is to move the fallback
> logic into get_conflictlog_dest_and_table() so the caller's code looks cleaner.
>
> And I think we could build the errdetail for both the table and
> logfile cases and call ereport() only once, to reduce the duplicated code.
>
> Please check the attached follow-up patches (on top of 0001), I hope it makes
> the code better.
>

I also think so but we can go a bit further to simplify this part by
removing the two booleans and ERROR level check inside the
ReportApplyConflict() function. See attached built atop your patch.
Additionally, tried improving the comments atop
get_conflictlog_dest_and_table() in the attached.

--
With Regards,
Amit Kapila.

Attachment

pgsql-hackers by date:

Previous
From: Manu
Date:
Subject: Re: [PATCH] Extensible ReadyForQuery wire protocol message and C hook, for connection pools and WAIT FOR LSN
Next
From: "zengxx"
Date:
Subject: Skip a redundant singleton GROUP BY node