Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit ad9f08f

Browse files
committed
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 cb1ca4d. Noted by Amit Langote, patch by Etsuro Fujita
1 parent d3821e7 commit ad9f08f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/backend/commands/tablecmds.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -4367,10 +4367,12 @@ ATSimpleRecursion(List **wqueue, Relation rel,
43674367
AlterTableCmd *cmd, bool recurse, LOCKMODE lockmode)
43684368
{
43694369
/*
4370-
* Propagate to children if desired. Non-table relations never have
4371-
* children, so no need to search in that case.
4370+
* Propagate to children if desired. Only plain tables and foreign tables
4371+
* have children, so no need to search for other relkinds.
43724372
*/
4373-
if (recurse && rel->rd_rel->relkind == RELKIND_RELATION)
4373+
if (recurse &&
4374+
(rel->rd_rel->relkind == RELKIND_RELATION ||
4375+
rel->rd_rel->relkind == RELKIND_FOREIGN_TABLE))
43744376
{
43754377
Oid relid = RelationGetRelid(rel);
43764378
ListCell *child;

0 commit comments

Comments
 (0)