CREATE PUBLICATION and foreign partitions

From: Sergey Tatarintsev <s(dot)tatarintsev(at)postgrespro(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: CREATE PUBLICATION and foreign partitions
Date: 2025-01-29 06:19:42
Message-ID: c78766fa-4eff-4805-ad9c-868f02954ad4@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello all!

Currently, according to logical replication restriction sections at [1],
"Attempts to replicate ... foreign tables, will result in an error."

But we don't care about partitioned tables with foreign partitions.

As we discussed here
https://www.postgresql.org/message-id/CAA4eK1Lhh4SgiYQLNiWSNKGdVSzbd53%3Dsr2tQCKooEphDkUtgw%40mail.gmail.com
we decided to discuss this issue separately.
I have attached patch for this issue.

The correction only applies to the case "CREATE PUBLICATION FOR TABLE",
but no "FOR ALL TABLES" and "TABLES IN SCHEMA" because table list built
during subscription.
And I have another patch that filters partitioned tables at subscription
time, but we can't throw an error in that case. I'm not sure if it's
interesting, because it changes the behavior

[1] -
https://www.postgresql.org/docs/devel/logical-replication-restrictions.html

Attachment Content-Type Size
0001-Attempts-to-replicate-partitioned-tables-with-foreig.patch text/x-patch 4.6 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey Tatarintsev 2025-01-29 06:26:08 Re: create subscription with (origin = none, copy_data = on)
Previous Message vignesh C 2025-01-29 06:15:18 Re: Introduce XID age and inactive timeout based replication slot invalidation