Remove code under GPDB_91_MERGE_FIXME in ATPrepAddColumn().
There are many tests which flow through this code path specifically in
alter_table.sql. Nothing exploded with the removal of the same and gpcheckcat
flagged nothing means its fine to delete the same.
@@ -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
