Destructive Operations

ALTER TABLE ... DROP COLUMN

Lock mode ACCESS EXCLUSIVE
Risk HIGH
Blocks reads, writes, other DDL
pgfence rule drop-column
ALTER TABLE orders DROP COLUMN legacy_notes;

What this does

Metadata-only: the column's storage is not physically removed until the table is next rewritten. The risk is application breakage, not lock duration; any code still reading the column errors immediately.

Safe rewrite

Remove all application references first, then drop in a follow-up migration

-- 1. Stop reading "legacy_notes" in application code.
-- 2. Deploy the code change and verify in production.
-- 3. Drop the column in a separate migration:
ALTER TABLE orders DROP COLUMN IF EXISTS legacy_notes;

Read more

More in Destructive Operations