Re: Proposal: Conflict log history table for Logical Replication

Zsolt Parragi <zsolt.parragi@percona.com>

From: Zsolt Parragi <zsolt.parragi@percona.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2026-06-03T13:58:51Z
Lists: pgsql-hackers
Hello

+				snprintf(conflictlogtable,
+						 sizeof(conflictlogtable),
+						 "%s.pg_conflict_log_for_subid_%s",
+						 conflict_schema, subid);

This and a few some places / commit message use
pg_conflict_log_for_subid_<oid>, but the proper name seems to be

+	snprintf(relname, NAMEDATALEN, "pg_conflict_log_%u", subid);

@@ -1767,6 +1771,10 @@ apply_handle_stream_start(StringInfo s)
 				(errcode(ERRCODE_PROTOCOL_VIOLATION),
 				 errmsg_internal("invalid transaction ID in streamed replication
transaction")));

+	remote_xid = stream_xid;
+	remote_final_lsn = InvalidXLogRecPtr;
+	remote_commit_ts = 0;

Shouldn't apply_handle_begin_prepare also write out the xid/commit_ts?



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Allow logical replication conflicts to be logged to a table.

  2. Avoid orphaned objects dependencies