Adding a new column is one of the most common database changes. It should be simple, but scale, downtime, and migration strategy can turn it into a risky operation. Whether you’re adjusting a schema in PostgreSQL, MySQL, or a distributed datastore, the details matter.
A new column changes your storage structure. In relational databases, adding a column with a default value can lock the table and block writes until the operation completes. Large datasets can make this pause unacceptable. For zero-downtime schema changes, you need a plan.
In PostgreSQL, adding a nullable column without a default is fast. The change is recorded in the system catalog without rewriting the table. With a default value, newer versions optimize by storing metadata instead of rewriting all rows, but older versions still require a full table rewrite. In MySQL, especially on older storage engines, adding columns can trigger a copy of the table. Online DDL operations reduce this impact but may still cause replication lag.