Adding a new column in a production database should be simple. It isn’t. Schema changes carry risk—downtime, blocked queries, and unpredictable replication lag. Whether you use PostgreSQL, MySQL, or a modern distributed database, the challenge remains the same: applying a new column without breaking the rest of the system.
The first rule is to never block critical reads or writes. Adding a new column with a default value in one step can lock the table and stall the application. Instead, create the column without defaults or non-null constraints, then backfill data in controlled batches. This keeps query performance predictable and avoids long transactions.
In PostgreSQL, ALTER TABLE ... ADD COLUMN is usually fast if the new column is nullable with no default. In MySQL, especially with older storage engines, even a simple new column can trigger a full table rebuild. Planning for the underlying engine’s behavior is as important as writing the SQL.