Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 1.32 KB

alter-table.md

File metadata and controls

22 lines (18 loc) · 1.32 KB
title summary toc
ALTER TABLE
Use the ALTER TABLE statement to change the schema of a table.
false

The ALTER TABLE statement applies a schema change to a table.

{{site.data.alerts.callout_info}}To understand how CockroachDB changes schema elements without requiring table locking or other user-visible downtime, see Online Schema Changes in CockroachDB.{{site.data.alerts.end}}

For information on using ALTER TABLE, see the documents for its relevant subcommands.

Subcommand Description
ADD COLUMN Add columns to tables.
ADD CONSTRAINT Add constraints to columns.
ALTER COLUMN Change a column's Default constraint or drop the Not Null constraint.
DROP COLUMN Remove columns from tables.
DROP CONSTRAINT Remove constraints from columns.
RENAME COLUMN Change the names of columns.
RENAME TABLE Change the names of tables.
SPLIT AT (Documentation pending) Potentially improve performance by identifying ideal locations to split data in the key-value layer.