MCPcopy Create free account
hub / github.com/apache/cloudberry / ATTypedTableRecursion

Function ATTypedTableRecursion

src/backend/commands/tablecmds.c:8024–8047  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

8022 * recursion to inheritance children of the typed tables.
8023 */
8024static void
8025ATTypedTableRecursion(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/*

Callers 3

ATPrepAddColumnFunction · 0.85
ATPrepDropColumnFunction · 0.85
ATPrepAlterColumnTypeFunction · 0.85

Calls 6

relation_openFunction · 0.85
CheckTableNotInUseFunction · 0.85
ATPrepCmdFunction · 0.85
relation_closeFunction · 0.85
foreachFunction · 0.50

Tested by

no test coverage detected