Adding a new column is one of the most common database schema changes. Done well, it is safe, fast, and predictable. Done poorly, it can lock tables, block queries, and bring down production.
A new column is not just an extra field. It changes the shape of every row in the table. It affects storage, indexes, queries, and replication. Plan it. Understand the database engine’s behavior. Then deploy with precision.
In PostgreSQL, a new column with a default value can rewrite an entire table. On large datasets, that can mean minutes—or hours—of downtime. To avoid this, add the column without a default, then backfill data in small batches. When complete, apply the default for future inserts.
In MySQL, adding a nullable column is typically fast with InnoDB, but adding a column in the middle of a table definition can still require a full table rebuild. Always benchmark migrations in staging first.