Adding a new column is one of the most common schema changes in relational databases. It seems simple, but in production, even small DDL changes can lock tables, block writes, or create downtime if done without care. Tools and techniques for adding a column vary by database, but the core concerns remain: performance, safety, and backward compatibility.
In PostgreSQL, ALTER TABLE ... ADD COLUMN is transactional. It’s fast for nullable columns without defaults, but slow if you set a non-null default—because it rewrites the table. In MySQL, ALTER TABLE can copy the whole table, but recent versions and some storage engines support instant adds for certain column types. In SQLite, adding a column is straightforward but limited to end-of-table schema changes.
Planning a new column in production means deciding where it fits in versioning. First, deploy code that ignores its absence. Then, run the migration. Then, update the application to use it. This sequence avoids race conditions and broken queries. Use migration tooling that runs in small, safe steps. Test on real-size data before hitting the live environment.