Adding a new column is one of the most common schema migrations, but it is also one of the most dangerous if done without precision. Rows may lock. Queries may stall. Deploys may fail under live traffic. The work is simple in syntax, but complex in timing.
In PostgreSQL, ALTER TABLE ADD COLUMN runs fast if it uses a default of NULL and has no constraints. With a default value, the database must rewrite every row. MySQL’s behavior differs, often requiring a table copy. In large tables, this can mean minutes or hours of downtime unless you use online DDL features.
Before adding a new column in production, check your indexes and foreign keys. Removing or delaying constraints can make migrations safer. Always replicate the change in staging with realistic dataset sizes. Measure runs. Observe lock times. Build rollback scripts.