diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c index 05593f3316..679c2ce6a7 100644 --- a/src/backend/commands/tablecmds.c +++ b/src/backend/commands/tablecmds.c @@ -7080,6 +7080,15 @@ ATExecDropColumn(List **wqueue, Relation rel, const char *colName, ReleaseSysCache(tuple); /* + * Perform the actual column deletion + */ + object.classId = RelationRelationId; + object.objectId = RelationGetRelid(rel); + object.objectSubId = attnum; + + performDeletion(&object, behavior, 0); + + /* * Propagate to children as appropriate. Unlike most other ALTER * routines, we have to do this one level of recursion at a time; we can't * use find_all_inheritors to do it in one pass. @@ -7170,15 +7179,6 @@ ATExecDropColumn(List **wqueue, Relation rel, const char *colName, table_close(attr_rel, RowExclusiveLock); } - /* - * Perform the actual column deletion - */ - object.classId = RelationRelationId; - object.objectId = RelationGetRelid(rel); - object.objectSubId = attnum; - - performDeletion(&object, behavior, 0); - return object; }