Zero-Downtime Schema Migrations in PostgreSQL
Most schema changes are instant. A few take heavy locks or rewrite entire tables, which can freeze a busy app. Knowing which is which is the key to safe migrations. Always set a lock timeout SET lock_timeout = '5s'; ALTER TABLE orders ADD COLUMN notes TEXT; Ev...