Adding a new column should be simple. In SQL, it’s the ALTER TABLE ADD COLUMN statement. In modern databases, it can run online, without blocking reads or writes. But in real systems, the way you add a column matters. Schema changes touch migration files, ORM models, test environments, and deployment pipelines. One missed step and you ship broken code—or worse, corrupt data.
A new column in PostgreSQL is straightforward when the default value is NULL. It’s a metadata change. Instant. But attach a non-null default and the database will rewrite every row. On big tables, that can lock queries for hours. MySQL can behave differently depending on the storage engine. SQLite updates the whole table. Each platform demands awareness of how it will handle the change before you run it in production.
The process starts in source control with a migration file. Keep it small. First, create the new column without a default. Backfill data in controlled batches. Then add constraints. This keeps transactions fast and the schema consistent. In distributed systems, you may need versioned schemas so old and new code can run in parallel.