diff options
author | Tom Lane | 2015-04-28 19:25:00 +0000 |
---|---|---|
committer | Tom Lane | 2015-04-28 19:25:00 +0000 |
commit | ad9f08f70636051b5d5fe8d57062994b7335a960 (patch) | |
tree | a1e226f9e9824461e13c10c28654ff9e922cd2ce /src/backend/commands | |
parent | d3821e70c9b6d76083f4eb0f4cc25716e961c89d (diff) |
Fix ATSimpleRecursion() to allow recursion from a foreign table.
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
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/tablecmds.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index bedd8aeb782..5d842857523 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -4367,10 +4367,12 @@ ATSimpleRecursion(List **wqueue, Relation rel, 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; |