Re: Proposal: Conflict log history table for Logical Replication

Peter Smith <smithpb2250@gmail.com>

From: Peter Smith <smithpb2250@gmail.com>
To: Dilip Kumar <dilipbalaut@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, shveta malik <shveta.malik@gmail.com>, vignesh C <vignesh21@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-01-19T03:22:21Z
Lists: pgsql-hackers
Some review comments for v22-0002

======
1. Nit. "JSON" versus "json" capitalisation

Whichever way you choose, the patch should have consistent
capitalisation in all your comments.

Sometimes UPPERCASE
-------------------

single JSON array in the local_conflicts column.

The JSON array uses the following structured format:

+/* Schema for the elements within the 'local_conflicts' JSON array */

+ /* Convert to a JSON datum. */

+ * Builds the local conflicts JSON array column from the list of

+ /* Process local conflict tuple list and prepare an array of JSON. */

+ /* Convert conflicting tuple to JSON datum. */

+ * Build the higher level JSON datum in format described in function

+# Verify that '2' is present inside the JSON structure using a regex

+# Verify that '6' is present inside the JSON structure using a regex

Sometimes lowercase
-------------------

+ * Fetch replica identity key from the tuple table slot and convert into a
+ * json datum.

+ List    *json_datums = NIL; /* List to hold the row_to_json results
(type json) */

+ /* Construct the json[] array Datum. */

+ * json datum from key value. Otherwise, construct it from the complete

======
src/backend/replication/logical/conflict.c

tuple_table_slot_to_json_datum:

2.
+ * Helper function to convert a TupleTableSlot to Jsonb.

This 'Jsonb' comment was accidentally missed when you changed all
previous jsonb to json?

======
Kind Regards,
Peter Smith.
Fujitsu Australia



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