pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Kapila <akapila@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix Alter Subscription's Add/Drop Publication behavior.
Date: Tue, 24 Aug 2021 03:27:43 +0000
Message-ID: <E1mIN6F-0004oH-63@gemulon.postgresql.org> (raw)

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
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5cfcd46e9d297eac627bf3183272713112ac5f60

Modified Files
--------------
doc/src/sgml/ref/alter_subscription.sgml     |  7 +-
src/backend/commands/subscriptioncmds.c      |  7 +-
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/021_alter_sub_pub.pl | 98 ++++++++++++++++++++++++++++
6 files changed, 105 insertions(+), 21 deletions(-)



view thread (2+ messages)

Message-ID: <E1mIN6F-0004oH-63@gemulon.postgresql.org>
Permalink:  ../E1mIN6F-0004oH-63@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1mIN6F-0004oH-63@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: akapila@postgresql.org
  Subject: Re: pgsql: Fix Alter Subscription's Add/Drop Publication behavior.
  In-Reply-To: <E1mIN6F-0004oH-63@gemulon.postgresql.org>
  References: <E1mIN6F-0004oH-63@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox