mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Fix Alter Subscription's Add/Drop Publication behavior.
The current refresh behavior tries to just refresh added/dropped publications but that leads to removing wrong tables from subscription. We can't refresh just the dropped publication because it is quite possible that some of the tables are removed from publication by that time and now those will remain as part of the subscription. Also, there is a chance that the tables that were part of the publication being dropped are also part of another publication, so we can't remove those. So, we decided that by default, add/drop commands will also act like REFRESH PUBLICATION which means they will refresh all the publications. We can keep the old behavior for "add publication" but it is better to be consistent with "drop publication". Author: Hou Zhijie Reviewed-by: Masahiko Sawada, Amit Kapila Backpatch-through: 14, where it was introduced Discussion: https://postgr.es/m/OS0PR01MB5716935D4C2CC85A6143073F94EF9@OS0PR01MB5716.jpnprd01.prod.outlook.com
This commit is contained in:
@ -106,9 +106,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
|
||||
publications, and <literal>DROP</literal> removes the publications from
|
||||
the list of publications. See <xref linkend="sql-createsubscription"/>
|
||||
for more information. By default, this command will also act like
|
||||
<literal>REFRESH PUBLICATION</literal>, except that in case of
|
||||
<literal>ADD</literal> or <literal>DROP</literal>, only the added or
|
||||
dropped publications are refreshed.
|
||||
<literal>REFRESH PUBLICATION</literal>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@ -129,8 +127,7 @@ ALTER SUBSCRIPTION <replaceable class="parameter">name</replaceable> RENAME TO <
|
||||
</variablelist>
|
||||
|
||||
Additionally, refresh options as described
|
||||
under <literal>REFRESH PUBLICATION</literal> may be specified,
|
||||
except in the case of <literal>DROP PUBLICATION</literal>.
|
||||
under <literal>REFRESH PUBLICATION</literal> may be specified.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
Reference in New Issue
Block a user