PS_NITPICKS_20240822_CDR_V200001.txt

text/plain

Filename: PS_NITPICKS_20240822_CDR_V200001.txt
Type: text/plain
Part: 0
Message: Re: Conflict detection and logging in logical replication
diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index 3df791a..a3a0eae 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -1670,11 +1670,10 @@ test_sub=# SELECT * FROM t1 ORDER BY id;
    The log format for logical replication conflicts is as follows:
 <synopsis>
 LOG:  conflict detected on relation "<replaceable>schemaname</replaceable>.<replaceable>tablename</replaceable>": conflict=<replaceable>conflict_type</replaceable>
-DETAIL:  <replaceable class="parameter">detailed explanation</replaceable>.
-<optional>
-<literal>Key</literal> (<replaceable>column_name</replaceable>, ...)=(<replaceable>column_value</replaceable>, ...)</optional>
-<optional>; <literal>existing local tuple</literal> <optional>(<replaceable>column_name</replaceable>, ...)=</optional>(<replaceable>column_value</replaceable>, ...)</optional><optional>; <literal>remote tuple</literal> <optional>(<replaceable>column_name</replaceable>, ...)=</optional>(<replaceable>column_value</replaceable>, ...)</optional><optional>; <literal>replica identity</literal> {(<replaceable>column_name</replaceable>, ...)=(<replaceable>column_value</replaceable>, ...) | full (<replaceable>column_value</replaceable>, ...)}</optional>.
+DETAIL:  <replaceable class="parameter">detailed_explanation</replaceable>.
+<optional><literal>Key</literal> (<replaceable>column_name</replaceable>, ...)=(<replaceable>column_value</replaceable>, ...)</optional><optional>; <literal>existing local tuple</literal> <optional>(<replaceable>column_name</replaceable>, ...)=</optional>(<replaceable>column_value</replaceable>, ...)</optional><optional>; <literal>remote tuple</literal> <optional>(<replaceable>column_name</replaceable>, ...)=</optional>(<replaceable>column_value</replaceable>, ...)</optional><optional>; <literal>replica identity</literal> {(<replaceable>column_name</replaceable>, ...)=(<replaceable>column_value</replaceable>, ...) | full (<replaceable>column_value</replaceable>, ...)}</optional>.
 </synopsis>
+
    The log provides the following information:
    <variablelist>
     <varlistentry>
@@ -1683,28 +1682,34 @@ DETAIL:  <replaceable class="parameter">detailed explanation</replaceable>.
        <itemizedlist>
         <listitem>
          <para>
-         The name of the local relation involved in the conflict and the conflict
-         type (e.g., <literal>insert_exists</literal>,
-         <literal>update_exists</literal>).
+         <replaceable>schemaname</replaceable>.<replaceable>tablename</replaceable>
+         identifies the local relation involved in the conflict.
+         </para>
+        </listitem>
+        <listitem>
+         <para>
+         <replaceable>conflict_type</replaceable> is the type of conflict that occurred
+         (e.g., <literal>insert_exists</literal>, <literal>update_exists</literal>).
          </para>
         </listitem>
        </itemizedlist>
       </listitem>
     </varlistentry>
+
     <varlistentry>
      <term><literal>DETAIL</literal></term>
       <listitem>
       <itemizedlist>
        <listitem>
         <para>
-         The origin, transaction ID, and commit timestamp of the transaction that
-         modified the existing local tuple, if available, are included in the
-         <replaceable class="parameter">detailed explanation</replaceable>.
+         <replaceable class="parameter">detailed_explanation</replaceable> includes
+         the origin, transaction ID, and commit timestamp of the transaction that
+         modified the existing local tuple, if available.
         </para>
        </listitem>
        <listitem>
         <para>
-         The <literal>key</literal> section includes the key values of the local
+         The <literal>Key</literal> section includes the key values of the local
          tuple that violated a unique constraint <literal>insert_exists</literal>
          or <literal>update_exists</literal> conflicts.
         </para>
@@ -1732,7 +1737,20 @@ DETAIL:  <replaceable class="parameter">detailed explanation</replaceable>.
          The <literal>replica identity</literal> section includes the replica
          identity key values that used to search for the existing local tuple to
          be updated or deleted. This may include the full tuple value if the local
-         relation is marked with <literal>REPLICA IDENTITY FULL</literal>.
+         relation is marked with
+         <link linkend="sql-altertable-replica-identity-full"><literal>REPLICA IDENTITY FULL</literal></link>.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         <replaceable class="parameter">column_name</replaceable> is the column name.
+         These are optionally logged and, if present, are in the same order as the
+         corresponding column value.
+        </para>
+       </listitem>
+       <listitem>
+        <para>
+         <replaceable class="parameter">column_value</replaceable> is the column value.
         </para>
        </listitem>
       </itemizedlist>