From: | Amit Kapila <akapila(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: Fix Alter Subscription's Add/Drop Publication behavior. |
Date: | 2021-08-24 03:27:43 |
Message-ID: | E1mIN6F-0004oG-5a@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
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
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/1046a69b3087a6417e85cae9b6bc76caa22f913b
Modified Files
--------------
doc/src/sgml/ref/alter_subscription.sgml | 7 +--
src/backend/commands/subscriptioncmds.c | 9 +--
src/bin/psql/tab-complete.c | 8 +--
src/test/regress/expected/subscription.out | 3 -
src/test/regress/sql/subscription.sql | 3 -
src/test/subscription/t/024_add_drop_pub.pl | 98 +++++++++++++++++++++++++++++
6 files changed, 105 insertions(+), 23 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Kapila | 2021-08-24 06:56:02 | Re: Separate out FileSet from SharedFileSet (was Re: pgsql: pgstat: Bring up pgstat in BaseInit() to fix uninitialized use o) |
Previous Message | Tom Lane | 2021-08-23 21:41:33 | pgsql: Prevent regexp back-refs from sometimes matching when they shoul |