[HACKERS] Logical replication and inheritance - Mailing list pgsql-hackers

From Amit Langote
Subject [HACKERS] Logical replication and inheritance
Date
Msg-id 92ea7dd8-70b9-16c6-9327-e67e56209f33@lab.ntt.co.jp
Whole thread Raw
Responses Re: [HACKERS] Logical replication and inheritance  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
List pgsql-hackers
I see that if the table is a inheritance parent, and ONLY is not
specified, the child tables are also added to the publication.

create table parent (a int);
create table child () inherits (parent);
create publication parent_pub for table parent;
\d parent              Table "public.parent"Column |  Type   | Collation | Nullable | Default
--------+---------+-----------+----------+---------a      | integer |           |          |
Publications:   "parent_pub"
Number of child tables: 1 (Use \d+ to list them.)

\d child              Table "public.child"Column |  Type   | Collation | Nullable | Default
--------+---------+-----------+----------+---------a      | integer |           |          |
Publications:   "parent_pub"
Inherits: parent

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

alter table child no inherit parent;
ALTER TABLE
\d child              Table "public.child"Column |  Type   | Collation | Nullable | Default
--------+---------+-----------+----------+---------a      | integer |           |          |
Publications:   "parent_pub"

Perhaps that's intentional?

Thanks,
Amit





pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: [HACKERS] pg_dump does not refresh matviews from extensions
Next
From: Amit Langote
Date:
Subject: Re: [HACKERS] Documentation improvements for partitioning