add_caution.diffs

application/octet-stream

Filename: add_caution.diffs
Type: application/octet-stream
Part: 0
Message: RE: BUG #18644: ALTER PUBLICATION ... SET (publish_via_partition_root) wrong/undocumented behavior.
diff --git a/doc/src/sgml/ref/alter_publication.sgml b/doc/src/sgml/ref/alter_publication.sgml
index 44ae7e0e87..dedf30ec12 100644
--- a/doc/src/sgml/ref/alter_publication.sgml
+++ b/doc/src/sgml/ref/alter_publication.sgml
@@ -154,6 +154,22 @@ ALTER PUBLICATION <replaceable class="parameter">name</replaceable> RENAME TO <r
       This clause alters publication parameters originally set by
       <xref linkend="sql-createpublication"/>.  See there for more information.
      </para>
+     <caution>
+      <para>
+       When the partition root table is explicitly specified as the replication
+       target instead of its leaf, altering the
+       <literal>publish_via_partition_root</literal> during the replication can
+       lead to data loss or duplication. This is because the publisher
+       replicates changes as the partitioned table after the altering, but it
+       is not listed in
+       <link linkend="catalog-pg-subscription-rel"><literal>pg_subscription_rel</literal></link>.
+      </para>
+      <para>
+       To prevent the issue, you can avoid modifying the partitioned root table
+       between the <command>ALTER PUBLICATION ... SET</command> and
+       <link linkend="sql-altersubscription"><command>ALTER SUBSCRIPTION ... REFRESH PUBLICATION</command></link>.
+      </para>
+     </caution>
     </listitem>
    </varlistentry>