diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index eac1d6f3c6b34f2912902ea19620c3b334bc9ec3..a03b5349a76b6fb5e9e8b84dbc0ad95833d87774 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -6893,76 +6893,6 @@ ATPrepAddColumn(List **wqueue, Relation rel, bool recurse, bool recursing, elog(ERROR, "unexpected ALTER TABLE subtype %d in ADD COLUMN command", cmd->subtype); } - - /* GPDB_91_MERGE_FIXME: I don't know if this is still needed or not. - * Perhaps not, because of the new way OIDs are dispatched. We'll see when - * we get to test this, I suppose. - */ -#if 0 - if (recurse) - { - /* - * We are the master and the table has child(ren): - * internally create and execute new AlterTableStmt(s) on child(ren) - * before dispatching the original AlterTableStmt - * This is to ensure that pg_constraint oid is consistent across segments for - * ALTER TABLE ... ADD COLUMN ... CHECK ... - */ - if (Gp_role == GP_ROLE_DISPATCH) - { - List *children; - ListCell *lchild; - - children = find_inheritance_children(RelationGetRelid(rel), NoLock); - DestReceiver *dest = None_Receiver; - foreach(lchild, children) - { - Oid childrelid = lfirst_oid(lchild); - Relation childrel; - - RangeVar *rv; - AlterTableCmd *atc; - AlterTableStmt *ats; - - if (childrelid == RelationGetRelid(rel)) - continue; - - childrel = heap_open(childrelid, AccessShareLock); - CheckTableNotInUse(childrel, "ALTER TABLE"); - - /* Recurse to child */ - atc = copyObject(cmd); - if (cmd->subtype == AT_AddColumn || cmd->subtype == AT_AddColumnRecurse) - atc->subtype = AT_AddColumnRecurse; - else if (cmd->subtype == AT_AddOids) - atc->subtype = AT_AddOidsRecurse; - else - elog(ERROR, "unexpected ALTER TABLE subtype %d in ADD COLUMN command", - cmd->subtype); - - /* Child should see column as singly inherited */ - ((ColumnDef *) atc->def)->inhcount = 1; - ((ColumnDef *) atc->def)->is_local = false; - - rv = makeRangeVar(get_namespace_name(RelationGetNamespace(childrel)), - get_rel_name(childrelid), -1); - - ats = makeNode(AlterTableStmt); - ats->relation = rv; - ats->cmds = list_make1(atc); - ats->relkind = OBJECT_TABLE; - - heap_close(childrel, NoLock); - - ProcessUtility((Node *)ats, - synthetic_sql, - NULL, - false, /* not top level */ - dest, - NULL); - } - } -#endif } static void