Adding a new column to a database can be trivial or it can break production. The difference comes down to execution. Schema changes must be fast, safe, and reversible. When you add a column to a relational database—PostgreSQL, MySQL, or even SQLite—you’re altering a live structure that may have millions of rows and high read/write traffic.
The first question is definition. Decide the column name, data type, nullability, and default values before you touch the schema. This matters for query performance and for avoiding later migrations. Use consistent naming conventions. Choose the smallest data type that can handle the range of expected values.
For PostgreSQL, a simple migration to add a nullable column is usually instant:
ALTER TABLE orders ADD COLUMN processed_at TIMESTAMP;
But if the column requires a default value, especially on a huge table, PostgreSQL will rewrite the entire table. This can lock writes and slow reads. In MySQL, adding a column can be online with ALGORITHM=INPLACE, but compatibility depends on storage engine and version.