Subject: Re: Logical replication and inheritance

From: Peter Eisentraut <[email-masked]>
Date: Fri, 3 Mar 2017 14:24:16 -0500

On 2/27/17 01:57, Amit Langote wrote:
> I see that if the table is a inheritance parent, and ONLY is not
> specified, the child tables are also added to the publication.

> If the child table is later removed from the inheritance hierarchy, it
> continues to be a part of the publication.

> Perhaps that's intentional?

I came across this the other day as well.  It's not clear what the best
way for this to behave would be.  Another option would be to check the
then-current inheritance relationships in the output plugin.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

-- 
Sent via pgsql-hackers mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

---

From: Amit Langote <[email-masked]>
Date: Mon, 6 Mar 2017 18:04:29 +0900

> then-current inheritance relationships in the output plugin.

I thought removal of a table from inheritance hierarchy would delete it
from publications that its parents are part of.

One more option is for OpenTableList() called by CreatePublication() and
AlterPublicationTables() to not disregard inheritance, as if ONLY was
specified.

Related: I noticed that if you dump a database containing a publication
and an inheritance parent is published by it, loading that into another
database causes the following error for each child.

ERROR:  relation "bar" is already member of publication "foo_pub"

Because when foo, the parent, is added to foo_pub publication, bar (a
child of foo) is added implicitly.

Thanks,
Amit

---

From: Amit Langote <[email-masked]>
Date: Mon, 6 Mar 2017 18:09:32 +0900

> AlterPublicationTables() to not disregard inheritance, as if ONLY was

Oops, meant to say: One more option is for OpenTableList to disregard
inheritance...

Thanks,
Amit