The query ran. The result set returned. But something was missing: a new column.
Adding a new column should be simple. It can also break everything if you get it wrong. Schema changes touch live data, production workloads, and application logic. If your database holds millions of rows, an unplanned ALTER TABLE can lock the table, stall queries, and trigger cascading failures.
A new column affects both storage and indexes. Adding it without a default can speed deployment but leave nulls scattered through your data. Adding it with a default can rewrite the entire table. The right choice depends on table size, database engine, and uptime needs.
For SQL databases like PostgreSQL and MySQL, use ALTER TABLE ... ADD COLUMN with caution. On large or busy tables, consider online schema changes with tools like pt-online-schema-change or native features such as PostgreSQL’s non-blocking default addition. Test the change on a production-like environment. Watch execution plans after the update, especially if the column will later serve as a join key or filter.