On this page
Related contents
ALTER TABLE
Modifies an existing table in the system.
Syntax
ALTER TABLE [ IF EXISTS ] <table_name>
RENAME TO <new_table_name>
ALTER TABLE [ IF EXISTS ] <table_name>
ADD COLUMN <col_name> <col_type>
ALTER TABLE [ IF EXISTS ] <table_name>
DROP COLUMN <col_name>
ALTER TABLE [ IF EXISTS ] <table_name>
DISTINCT ON <expr> [, ...] [ BY <order_by_expr> [, ...] ]
ALTER TABLE [ IF EXISTS ] <table_name>
DROP DISTINCT KEY
ALTER TABLE [ IF EXISTS ] <table_name>
PARTITION BY <expr> [, ...]
ALTER TABLE [ IF EXISTS ] <table_name>
DROP PARTITION KEY
ALTER TABLE [ IF EXISTS ] <table_name>
CLUSTER BY <expr> [, ...]
ALTER TABLE [ IF EXISTS ] <table_name>
DROP CLUSTER KEY
ALTER TABLE [ IF EXISTS ] <table_name>
SET DATA RETENTION <days> DAY
ALTER TABLE [ IF EXISTS ] <table_name>
DROP DATA RETENTION
Data retention
SET DATA RETENTION configures a table-level retention window. <days> must
be a whole number from 1 through 1825. DROP DATA RETENTION removes the policy
without restoring data that has already been removed.
ALTER TABLE events SET DATA RETENTION 90 DAY;
ALTER TABLE events DROP DATA RETENTION;
See Set data retention for lifecycle behavior and how to inspect the current policy.
On this page
Related contents