ALTER TABLE ALTER COLUMN DROP DEFAULT

Removes the default value expression from a column. INSERTs that omit the column afterward receive NULL (or fail if the column is NOT NULL).

Category: ddl

Syntax

ALTER TABLE <table> ALTER COLUMN <column> DROP DEFAULT

Description

## Overview ALTER TABLE ALTER COLUMN DROP DEFAULT removes the default expression from a column's metadata. After the drop, INSERTs that omit the column receive NULL. If the column is also NOT NULL, INSERTs that omit it fail. ## Behavior - Existing rows are not modified. Values previously inserted by the default expression remain as concrete values on disk. - DROP DEFAULT is a no-op when the column has no default. The ALTER still produces a new commit on the parent table. - The drop affects future INSERTs only. Schema-level NOT NULL constraints are unchanged; if the column is NOT NULL with no default, INSERTs that omit it now fail. ## Access Control No specific privilege is required beyond table-level access in the standalone SQL layer. ## Compatibility Standard SQL syntax.

Parameters

NameTypeDescription
tableSpecifies the Delta table to alter.
column_nameSpecifies the column whose default expression to remove. The column must already exist.

Examples

-- Remove the default from a status column
ALTER TABLE orders ALTER COLUMN status DROP DEFAULT;

Pitfalls

See Also

Open in interactive docs →   DeltaForge home →