Adding a new column is one of the most common database schema changes. Done well, it is trivial. Done badly, it locks tables, slows deployments, and risks data loss. Whether you use PostgreSQL, MySQL, or SQLite, the process matters.
In PostgreSQL, ALTER TABLE ADD COLUMN runs instantly for nullable columns without defaults, but adding a column with a default value will rewrite the table unless you use DEFAULT ... with NOT NULL after backfilling. MySQL’s ALTER TABLE ADD COLUMN may trigger a full table copy unless you use ALGORITHM=INPLACE where supported. SQLite requires creating a new table with the updated schema and copying data.
When adding a new column in production, protect uptime. First, add the column as nullable with no default. Deploy application code that can handle the column being empty. Backfill data in batches to avoid locks or replication lag. Only then add constraints or defaults. This two-step migration pattern avoids long locks while keeping the schema consistent.