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

Function ATPrepDropColumn

src/backend/commands/tablecmds.c:10246–10261  ·  view source on GitHub ↗

* ALTER TABLE DROP COLUMN * * DROP COLUMN cannot use the normal ALTER TABLE recursion mechanism, * because we have to decide at runtime whether to recurse or not depending * on whether attinhcount goes to zero or not. (We can't check this in a * static pre-pass because it won't handle multiple inheritance situations * correctly.) */

Source from the content-addressed store, hash-verified

10244 * correctly.)
10245 */
10246static void
10247ATPrepDropColumn(List **wqueue, Relation rel, bool recurse, bool recursing,
10248 AlterTableCmd *cmd, LOCKMODE lockmode,
10249 AlterTableUtilityContext *context)
10250{
10251 if (rel->rd_rel->reloftype && !recursing)
10252 ereport(ERROR,
10253 (errcode(ERRCODE_WRONG_OBJECT_TYPE),
10254 errmsg("cannot drop column from typed table")));
10255
10256 if (rel->rd_rel->relkind == RELKIND_COMPOSITE_TYPE)
10257 ATTypedTableRecursion(wqueue, rel, cmd, lockmode, context);
10258
10259 if (recurse)
10260 cmd->subtype = AT_DropColumnRecurse;
10261}
10262
10263void
10264set_random_distribution_if_drop_distkey(Relation rel, AttrNumber attnum)

Callers 1

ATPrepCmdFunction · 0.85

Calls 3

ATTypedTableRecursionFunction · 0.85
errcodeFunction · 0.50
errmsgFunction · 0.50

Tested by

no test coverage detected