This is necessary in view of the changes to allow foreign tables to be
full members of inheritance hierarchies, but I (tgl) unaccountably missed
it in commit
cb1ca4d800621dcae67ca6c799006de99fa4f0a5.
Noted by Amit Langote, patch by Etsuro Fujita
AlterTableCmd *cmd, bool recurse, LOCKMODE lockmode)
{
/*
- * Propagate to children if desired. Non-table relations never have
- * children, so no need to search in that case.
+ * Propagate to children if desired. Only plain tables and foreign tables
+ * have children, so no need to search for other relkinds.
*/
- if (recurse && rel->rd_rel->relkind == RELKIND_RELATION)
+ if (recurse &&
+ (rel->rd_rel->relkind == RELKIND_RELATION ||
+ rel->rd_rel->relkind == RELKIND_FOREIGN_TABLE))
{
Oid relid = RelationGetRelid(rel);
ListCell *child;