* ATTypedTableRecursion * * Propagate ALTER TYPE operations to the typed tables of that type. * Also check the RESTRICT/CASCADE behavior. Given CASCADE, also permit * recursion to inheritance children of the typed tables. */
| 8022 | * recursion to inheritance children of the typed tables. |
| 8023 | */ |
| 8024 | static void |
| 8025 | ATTypedTableRecursion(List **wqueue, Relation rel, AlterTableCmd *cmd, |
| 8026 | LOCKMODE lockmode, AlterTableUtilityContext *context) |
| 8027 | { |
| 8028 | ListCell *child; |
| 8029 | List *children; |
| 8030 | |
| 8031 | Assert(rel->rd_rel->relkind == RELKIND_COMPOSITE_TYPE); |
| 8032 | |
| 8033 | children = find_typed_table_dependencies(rel->rd_rel->reltype, |
| 8034 | RelationGetRelationName(rel), |
| 8035 | cmd->behavior); |
| 8036 | |
| 8037 | foreach(child, children) |
| 8038 | { |
| 8039 | Oid childrelid = lfirst_oid(child); |
| 8040 | Relation childrel; |
| 8041 | |
| 8042 | childrel = relation_open(childrelid, lockmode); |
| 8043 | CheckTableNotInUse(childrel, "ALTER TABLE"); |
| 8044 | ATPrepCmd(wqueue, childrel, cmd, true, true, lockmode, context); |
| 8045 | relation_close(childrel, NoLock); |
| 8046 | } |
| 8047 | } |
| 8048 | |
| 8049 | |
| 8050 | /* |
no test coverage detected