Adding a new column should be simple. It often isn’t. Schema changes can lock tables, stall production, and burn deploy windows. Choosing the wrong method can mean downtime or corrupt data. Choosing the right one can make the migration invisible to users.
In most relational databases, adding a new column is easy for small tables. For massive datasets under constant load, the approach changes. A naïve ALTER TABLE ADD COLUMN can block writes and reads until the operation completes. This risk makes understanding native database capabilities essential.
PostgreSQL can add a nullable column with a default instantly in newer versions, but older versions rewrite the table. MySQL allows instant column addition in some cases, but other changes trigger full table rebuilds. SQLite rewrites the table on any schema change. Cloud-managed platforms like BigQuery and Snowflake handle column additions differently, often without locks, but with their own constraints.
When deploying a new column, consider: