Adding a new column should be fast, predictable, and safe. Yet in production systems, schema changes can be risky. Downtime, migration delays, and inconsistent data can grind releases to a halt. The key is to treat a new column not as a quick patch, but as a controlled evolution of your database.
First, define the data type and constraints with precision. Avoid guessing; schema drift becomes expensive at scale. For nullable columns, default values matter. For non-nullable, populate the field incrementally before enforcing constraints. Always consider indexing, but know that adding an index during column creation can lock writes in some engines.
When adding a new column in PostgreSQL, ALTER TABLE ADD COLUMN is straightforward, but large tables require caution. Adding a column with a default value in older PostgreSQL versions rewrites the table — a performance hit for millions of rows. In MySQL, adding columns can trigger a full table copy, so test the DDL on a staging clone before shipping.