Logical replication and inheritance

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Logical replication and inheritance
Date: 2017-02-27 06:57:12
Message-ID: 92ea7dd8-70b9-16c6-9327-e67e56209f33@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-02-27 06:59:42 Re: Documentation improvements for partitioning
Previous Message Robert Haas 2017-02-27 06:55:33 Re: pg_dump does not refresh matviews from extensions