Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax

From: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
To: Li Japin <japinli(at)hotmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax
Date: 2021-01-28 04:22:11
Message-ID: CALj2ACWo3q_0=RxOGZreePo0JHmy=JnW8dpx1aetC4RoNgZR=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 27, 2021 at 7:35 PM Li Japin <japinli(at)hotmail(dot)com> wrote:
> > I don't see any problem if ALTER SUBSCRIPTION ... ADD PUBLICATION with
> > refresh true refreshes only the newly added publications, because what
> > we do in AlterSubscription_refresh() is that we fetch the tables
> > associated with the publications from the publisher, compare them with
> > the previously fetched tables from that publication and add the new
> > tables or remove the table that don't exist in that publication
> > anymore.
> >
> > For ALTER SUBSCRIPTION ... DROP PUBLICATION, also we can do the same
> > thing i.e. refreshes only the dropped publications.
> >
> > Thoughts?
>
> Agreed. We just only need to refresh the added/dropped publications. Furthermore, for publications that will be dropped, we do not need the “copy_data” option, right?

I think you are right. The copy_data option doesn't make sense for
ALTER SUBSCRIPTION ... DROP PUBLICATION, maybe we should throw an
error if the user specifies it. Of course, we need that option for
ALTER SUBSCRIPTION ... ADD PUBLICATION.

With Regards,
Bharath Rupireddy.
EnterpriseDB: http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2021-01-28 04:25:42 Re: Is Recovery actually paused?
Previous Message Kyotaro Horiguchi 2021-01-28 03:06:27 Re: Wrong usage of RelationNeedsWAL