On Wed, 9 Oct 2024 at 11:01, Hayato Kuroda (Fujitsu)
<kuroda.hayato@fujitsu.com> wrote:
>
> Dear Maxim, Amit,
>
> > Thank you, it should be work. Unfortunately my English writing now is
> > not good enough to suggest correct and easy to understand warnings in
> > the documentation about this issue.
>
> I've written a doc patch to add a caution in ALTER PUBLICATION page. How do you feel?
Few comments:
1) How about changing:
+ <para>
+ 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>
to:
When the partition root table is specified as the replication target
instead of its leaf tables, changing the publish_via_partition_root
parameter during replication can cause data loss or duplication. This
happens because the subscriber initially subscribed to the leaf
tables. After running the ALTER PUBLICATION ... SET and ALTER
SUBSCRIPTION ... REFRESH PUBLICATION command, the subscriber will
subscribe to the partition root table.
2) Should we change:
+ To prevent the issue, you can avoid modifying the partitioned table
+ between the <command>ALTER PUBLICATION ... SET</command> and
+ <link linkend="sql-altersubscription"><command>ALTER
SUBSCRIPTION ... REFRESH PUBLICATION</command></link>.
to:
+ To prevent the issue, you can avoid modifying the partitioned table
+ between the <command>ALTER PUBLICATION ... SET</command> and
+ <link linkend="sql-altersubscription"><command>ALTER
SUBSCRIPTION ... REFRESH PUBLICATION</command></link> and refresh
publication with copy_data as off.
Regards,
Vignesh