Adding a new column is one of the most common, and most dangerous, operations in a live database. If you do it wrong, you block writes, lock tables, and stall deployments. If you do it right, you keep schema evolution smooth under production load.
A new column can store additional attributes, enable fresh queries, and improve data modeling. It can also break downstream services if you ignore constraints, defaults, and nullability. The safest deployment path begins with a clear migration plan.
In PostgreSQL, adding a new column is straightforward:
ALTER TABLE users ADD COLUMN last_login TIMESTAMP;
But the implication is more than syntax. On large tables, adding a column with a default value can rewrite the entire table, causing downtime. Use NULL defaults first, then backfill data in small batches.
In MySQL, modern versions avoid full table locks for simple ADD COLUMN operations. Still, test every migration in staging against production-sized data before applying it.