On Wed, 29 Jan 2025 at 11:49, Sergey Tatarintsev <s.tatarint...@postgrespro.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