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

Поиск
Список
Период
Сортировка
От Bharath Rupireddy
Тема Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax
Дата
Msg-id CALj2ACUOkueP=JnF0nXsu0y1Z07dx=UGwftvXs25_Gm+whpkVg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax  (Amit Kapila <amit.kapila16@gmail.com>)
Ответы Re: Support ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION ... syntax  (Li Japin <japinli@hotmail.com>)
Список pgsql-hackers
On Wed, Jan 27, 2021 at 4:42 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Wed, Jan 27, 2021 at 3:16 PM Bharath Rupireddy
> <bharath.rupireddyforpostgres@gmail.com> wrote:
> >
> > On Wed, Jan 27, 2021 at 3:01 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
> > So, I think the new syntax, ALTER SUBSCRIPTION .. ADD/DROP PUBLICATION
> > will refresh the new and existing publications.
> >
>
> That sounds a bit unusual to me because when the user has specifically
> asked to just ADD Publication, we might refresh some existing
> Publication along with it?

Hmm. That's correct. I also feel we should not touch the existing
publications, only the ones that are added/dropped should be
refreshed. Because there will be an overhead of a SQL with more
publications(in fetch_table_list) when AlterSubscription_refresh() is
called with all the existing publications. We could just pass in the
newly added/dropped publications to AlterSubscription_refresh().

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?

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



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Greg Nancarrow
Дата:
Сообщение: Re: Parallel INSERT (INTO ... SELECT ...)
Следующее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Fix ALTER SUBSCRIPTION ... SET PUBLICATION documentation