Re: CREATE PUBLICATION and foreign partitions

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Sergey Tatarintsev <s(dot)tatarintsev(at)postgrespro(dot)ru>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: CREATE PUBLICATION and foreign partitions
Date: 2025-01-29 09:20:01
Message-ID: CALDaNm371r+j+rtKGE=1ox8bui17CFPbXGngfhXdcmoivOeAww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 29 Jan 2025 at 11:49, Sergey Tatarintsev
<s(dot)tatarintsev(at)postgrespro(dot)ru> wrote:
>
> 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

I felt that we should keep the behavior consistent for all the three
scenarios i.e. table/tables in schema/all tables publication.
Furthermore, we should account for the reverse scenario: if a
publication is present for a table, an error should be thrown if we
attempt to attach a partitioned table with a foreign table to the
published table.
I noticed these are handled in the patch that Shlok has provided at [1].

[1] - https://www.postgresql.org/message-id/flat/CANhcyEWTNKm-ewnOVL9EB4MA-Zbt8BP1rmuXtD%3DTVHKmXL3xGA%40mail.gmail.com

Regards,
Vignesh

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message jian he 2025-01-29 09:38:36 Re: Non-text mode for pg_dumpall
Previous Message Amit Kapila 2025-01-29 08:56:24 Re: Improve error handling for invalid slots and ensure a same 'inactive_since' time for inactive slots