From cfc2e09491a9d8f02e29610bca4934fae9acde38 Mon Sep 17 00:00:00 2001
From: Robert Treat <rob@xzilla.net>
Date: Fri, 3 Jan 2025 12:10:43 -0500
Subject: [PATCH] Replica Identity clarifications.

Based on discussion from James Coleman, Peter Smith, Laurenz Albe, and Amit Kapala.
---
 doc/src/sgml/logical-replication.sgml | 6 ++++--
 doc/src/sgml/ref/alter_table.sgml     | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/doc/src/sgml/logical-replication.sgml b/doc/src/sgml/logical-replication.sgml
index 8290cd1a08..65996a3f9e 100644
--- a/doc/src/sgml/logical-replication.sgml
+++ b/doc/src/sgml/logical-replication.sgml
@@ -144,13 +144,15 @@
    fallback if no other solution is possible.  If a replica identity other
    than <literal>FULL</literal> is set on the publisher side, a replica identity
    comprising the same or fewer columns must also be set on the subscriber
-   side.  See <xref linkend="sql-altertable-replica-identity"/> for details on
-   how to set the replica identity.  If a table without a replica identity is
+   side.  If a table with replica identity set to <literal>NOTHING</literal>
+   (or set to use a primary key or index that doesn't exist) is
    added to a publication that replicates <command>UPDATE</command>
    or <command>DELETE</command> operations then
    subsequent <command>UPDATE</command> or <command>DELETE</command>
    operations will cause an error on the publisher.  <command>INSERT</command>
    operations can proceed regardless of any replica identity.
+   See <xref linkend="sql-altertable-replica-identity"/> for details on
+   how to set the replica identity.
   </para>
 
   <para>
diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml
index c8f7ab7d95..a09a5cc2ce 100644
--- a/doc/src/sgml/ref/alter_table.sgml
+++ b/doc/src/sgml/ref/alter_table.sgml
@@ -927,7 +927,8 @@ WITH ( MODULUS <replaceable class="parameter">numeric_literal</replaceable>, REM
        <term><literal>DEFAULT</literal></term>
        <listitem>
         <para>
-         Records the old values of the columns of the primary key, if any.
+         Records the old values of the columns of the primary key. When there
+         is no primary key, the behavior is the same as <literal>NOTHING</literal>.
          This is the default for non-system tables.
         </para>
        </listitem>
-- 
2.24.3 (Apple Git-128)

