Adding a new column to a production database sounds simple. It can break everything if you do it wrong. Schema changes alter the shape of your data and the performance of your queries. A safe change must consider indexes, default values, nullability, and locking behavior.
When you add a new column in PostgreSQL or MySQL, the database may lock the table. For high-traffic applications this can block writes and cause downtime. To avoid it, create the column without heavy default computations, then backfill in small batches. This keeps the change online while preserving data integrity.
Choose the correct data type. A wrong type forces costly casts later. If the new column must never be NULL, enforce it only after backfill is complete. Use ALTER TABLE with caution. Test it in a staging environment with realistic data sizes.