Hi,
I would like to propose a patch that improves the handling of table inheritance
hierarchies when adding tables to publications for logical replication.
Problem:
Currently, when attempting to add a parent table to a publication using, the operation fails
with an error if any of the inherited child tables are foreign tables, temporary tables, or unlogged tables. This makes it difficult to work with inheritance hierarchies in logical
replication scenarios, as users must manually manage which specific tables to
include or exclude.
Proposed Solution:
This patch modifies the behavior to automatically skip child tables that cannot
be replicated, rather than failing the entire operation. When unpublishable
children are encountered, a NOTICE message is issued following the same format
used by VACUUM and ANALYZE commands:
NOTICE: skipping "table_name" --- cannot add relation to publication
DETAIL: Foreign tables cannot be replicated.
The parent table and any publishable children are successfully added to the
publication.
I've attached the patch for review. Any feedback or suggestions for improvement
would be greatly appreciated.
Best regards,
Arun