Re: adding partitioned tables to publications

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: adding partitioned tables to publications
Дата
Msg-id CA+HiwqHNEPj5tvUYbTok5+Ty-UiwxtY+iys_O1DpdewNANma8A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: adding partitioned tables to publications  (David Fetter <david@fetter.org>)
Список pgsql-hackers
Hi David,

On Sun, Oct 13, 2019 at 4:55 PM David Fetter <david@fetter.org> wrote:
> On Mon, Oct 07, 2019 at 09:55:23AM +0900, Amit Langote wrote:
> > I propose that we make this command:
> >
> > create publication publish_p for table p;
> >
> > automatically add all the partitions to the publication.  Also, any
> > future partitions should also be automatically added to the
> > publication.  So, publishing a partitioned table automatically
> > publishes all of its existing and future partitions.  Attached patch
> > implements that.
> >
> > What doesn't change with this patch is that the partitions on the
> > subscription side still have to match one-to-one with the partitions
> > on the publication side, because the changes are still replicated as
> > being made to the individual partitions, not as the changes to the
> > root partitioned table.  It might be useful to implement that
> > functionality on the publication side, because it allows users to
> > define the replication target any way they need to, but this patch
> > doesn't implement that.
>
> With this patch, is it possible to remove a partition manually from a
> subscription, or will it just get automatically re-added at some
> point?

Hmm, I don't think there is any way (commands) to manually remove
tables from a subscription.  Testing shows that if you drop a table on
the subscription server that is currently being fed data via a
subscription, then a subscription worker will complain and quit if it
receives a row targeting the dropped table and workers that are
subsequently started will do the same thing.  Interestingly, this
behavior prevents replication for any other tables in the subscription
from proceeding, which seems unfortunate.

If you were asking if the patch extends the subscription side
functionality to re-add needed partitions that were manually removed
likely by accident, then no.

Thanks,
Amit



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: dropdb --force
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: pause recovery if pitr target not reached