Adding a new column to a database table is simple in theory. In practice, it can cause blocking, lock contention, migrations gone wrong, and even corrupt data if mishandled. Whether you use PostgreSQL, MySQL, or modern cloud databases, the wrong approach can cripple performance.
The safest way to add a new column starts with precision. First, define the schema change with explicit types and constraints. Avoid NULL defaults unless they fit your migration plan. Use ALTER TABLE in a way your database supports without full table rewrites. For high-traffic tables, break the change into small, controlled steps: add the column without constraints, backfill in batches, then apply indexes or foreign keys later.
For PostgreSQL:
ALTER TABLE orders ADD COLUMN shipped_at TIMESTAMP WITH TIME ZONE;
Run this in a transaction when you know it is safe. For MySQL, consider whether ALGORITHM=INPLACE is available to avoid a full lock.