* 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.) */
| 10244 | * correctly.) |
| 10245 | */ |
| 10246 | static void |
| 10247 | ATPrepDropColumn(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 | |
| 10263 | void |
| 10264 | set_random_distribution_if_drop_distkey(Relation rel, AttrNumber attnum) |
no test coverage detected