ALTER TABLE … DROP COLUMN removes an existing column and its data from an Amazon Redshift table.
Drop a column when it is obsolete, has been denormalized elsewhere, or stores erroneous data. Removing unused columns reduces disk usage and speeds up scans.
You need ownership of the table or superuser privileges.Granting ALTER on the table is insufficient; ownership is mandatory.
Use ALTER TABLE table_name DROP COLUMN column_name; Redshift reclaims space asynchronously, so the query finishes quickly while a background vacuum runs.
Yes. Since 2020, Redshift allows a comma-separated list: ALTER TABLE table_name DROP COLUMN col1, DROP COLUMN col2; This minimises lock time.
Redshift takes a metadata lock for milliseconds.Reads continue; writes wait briefly. Plan maintenance windows for heavy workloads.
Query SVV_COLUMNS or run SELECT * LIMIT 0; The dropped column no longer appears.
1) Always back up critical tables with UNLOAD or snapshot. 2) Test in a dev cluster. 3) Perform VACUUM DELETE after large drops to reclaim space sooner.
You must add a new column and reload data from backup.Redshift cannot undelete a column.
.
No. Redshift doesn’t support IF EXISTS in DROP COLUMN. Instead, query SVV_COLUMNS first to confirm the column exists.
Yes. Any dependent view becomes invalid. You must recreate or ALTER the view after dropping the column.
Space is freed after the next VACUUM DELETE. Schedule it soon after large drops to recover disk quickly.