From 240c0f57cdaaf80b3c04563c0ea8e98c72add01b Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Thu, 26 Nov 2026 14:57:29 +1100
Subject: [PATCH v1] doc: Reduce repeated "Note that" in logical replication 
 conflicts.

Several entries in the conflicts section used "Note that" two or three times
in one paragraph, which reads poorly and dilutes the emphasis. Remove the
repeats in the update_exists and update_deleted entries and in the paragraph
on resolving conflicts. Also make the sentances about
track_commit_timetamp use consistent wording ("ensure that" versus
"should be").

In the update_deleted entry, also say that update_missing is reported
instead when the row cannot be found because the table was truncated or
because the row was deleted by the same origin. The previous wording
("Additionally ... will arise") could be read as meaning that both
conflicts are reported.  The apply worker reports exactly one of
update_deleted or update_missing for an update.

Author: Peter Smith <smithpb2250@gmail.com>
Discussion: TBA
---
 doc/src/sgml/logical-replication.sgml | 38 +++++++++++++--------------
 1 file changed, 18 insertions(+), 20 deletions(-)

diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index 66dbb65aa48..8dd866487af 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -2053,10 +2053,10 @@ Included in publications:
       <listitem>
        <para>
         Inserting a row that violates a <literal>NOT DEFERRABLE</literal>
-        unique constraint. Note that to log the origin and commit
-        timestamp details of the conflicting key,
+        unique constraint. To log the origin and commit
+        timestamp details of the conflicting key, ensure that
         <link linkend="guc-track-commit-timestamp"><varname>track_commit_timestamp</varname></link>
-        should be enabled on the subscriber. In this case, an error will be
+        is enabled on the subscriber. In this case, an error will be
         raised until the conflict is resolved manually.
        </para>
       </listitem>
@@ -2066,7 +2066,7 @@ Included in publications:
       <listitem>
        <para>
         Updating a row that was previously modified by another origin.
-        Note that this conflict can only be detected when
+        This conflict can only be detected when
         <link linkend="guc-track-commit-timestamp"><varname>track_commit_timestamp</varname></link>
         is enabled on the subscriber. Currently, the update is always applied
         regardless of the origin of the local row.
@@ -2078,11 +2078,11 @@ Included in publications:
       <listitem>
        <para>
         The updated value of a row violates a <literal>NOT DEFERRABLE</literal>
-        unique constraint. Note that to log the origin and commit
-        timestamp details of the conflicting key,
+        unique constraint. To log the origin and commit
+        timestamp details of the conflicting key, ensure that
         <link linkend="guc-track-commit-timestamp"><varname>track_commit_timestamp</varname></link>
-        should be enabled on the subscriber. In this case, an error will be
-        raised until the conflict is resolved manually. Note that when updating a
+        is enabled on the subscriber. In this case, an error will be
+        raised until the conflict is resolved manually. When updating a
         partitioned table, if the updated row value satisfies another partition
         constraint resulting in the row being inserted into a new partition, the
         <literal>insert_exists</literal> conflict may arise if the new row
@@ -2095,14 +2095,13 @@ Included in publications:
       <listitem>
        <para>
         The tuple to be updated was concurrently deleted by another origin. The
-        update will simply be skipped in this scenario. Note that this conflict
+        update will simply be skipped in this scenario. This conflict
         can only be detected when
         <link linkend="guc-track-commit-timestamp"><varname>track_commit_timestamp</varname></link>
         and <link linkend="sql-createsubscription-params-with-retain-dead-tuples"><literal>retain_dead_tuples</literal></link>
-        are enabled. Note that if a tuple cannot be found due to the table being
-        truncated, only an <literal>update_missing</literal> conflict will
-        arise. Additionally, if the tuple was deleted by the same origin, an
-        <literal>update_missing</literal> conflict will arise.
+        are enabled. If the tuple cannot be found because the table was
+        truncated, or if the tuple was deleted by the same origin, an
+        <literal>update_missing</literal> conflict arises instead.
        </para>
       </listitem>
      </varlistentry>
@@ -2119,8 +2118,8 @@ Included in publications:
       <term><literal>delete_origin_differs</literal></term>
       <listitem>
        <para>
-        Deleting a row that was previously modified by another origin. Note that
-        this conflict can only be detected when
+        Deleting a row that was previously modified by another origin.
+        This conflict can only be detected when
         <link linkend="guc-track-commit-timestamp"><varname>track_commit_timestamp</varname></link>
         is enabled on the subscriber. Currently, the delete is always applied
         regardless of the origin of the local row.
@@ -2141,7 +2140,7 @@ Included in publications:
       <listitem>
        <para>
         Inserting or updating a row violates multiple
-        <literal>NOT DEFERRABLE</literal> unique constraints. Note that to log
+        <literal>NOT DEFERRABLE</literal> unique constraints. To log
         the origin and commit timestamp details of conflicting keys, ensure
         that <link linkend="guc-track-commit-timestamp"><varname>track_commit_timestamp</varname></link>
         is enabled on the subscriber. In this case, an error will be raised until
@@ -2589,12 +2588,11 @@ CONTEXT:  processing remote data for replication origin "pg_16395" during "INSER
     and the next LSN of the finish LSN (i.e., 0/014C0379).  The current position of
     origins can be seen in the <link linkend="view-pg-replication-origin-status">
     <structname>pg_replication_origin_status</structname></link> system view.
-    Please note that skipping the whole transaction includes skipping changes that
-    might not violate any constraint.  This can easily make the subscriber
-    inconsistent.
+    Skipping the whole transaction also skips changes that might not violate
+    any constraint, which can easily make the subscriber inconsistent.
     The additional details regarding conflicting rows, such as their origin and
     commit timestamp can be seen in the <literal>DETAIL</literal> line of the
-    log. But note that this information is only available when
+    log. However, this information is only available when
     <link linkend="guc-track-commit-timestamp"><varname>track_commit_timestamp</varname></link>
     is enabled on the subscriber. Users can use this information to decide
     whether to retain the local change or adopt the remote alteration. For
-- 
2.47.3

