Adding a new column sounds trivial until it blocks deploys, freezes queries, or triggers hours of downtime. The right approach depends on database type, indexing strategy, and how the field integrates with existing queries and services.
In PostgreSQL, ALTER TABLE ADD COLUMN works instantly if the column allows NULL and has no default value. Adding a DEFAULT on a large table can lock writes. The safer pattern is to add the column without a default, backfill in batches, then set the default and add constraints in a later step.
MySQL behaves differently. Adding a column can rebuild the table, locking reads and writes depending on storage engine and version. Using ALGORITHM=INPLACE or ALGORITHM=INSTANT when supported avoids full table copies. Always check SHOW VARIABLES LIKE 'innodb_version' to see if your engine supports the faster path.