Adding a new column is one of the most common schema changes in SQL. Done right, it is fast, predictable, and safe. Done wrong, it locks tables, breaks deployments, and corrupts data. Whether you use PostgreSQL, MySQL, or another relational database, the approach follows the same core steps.
First, define the purpose of the column. Know the data type, nullability, and default value before touching the schema. Changes in production demand absolute clarity. Avoid unnecessary nulls unless they are part of the model. Defaults should be explicit to prevent unexpected results in inserts and updates.
Second, assess the impact. On large tables, an ALTER TABLE ADD COLUMN can cause a full table rewrite or block writes. For PostgreSQL, adding a nullable column without a default is fast. Adding a default can lock the table unless you use version-specific features like ADD COLUMN ... DEFAULT ... with metadata-only changes. MySQL behavior depends on storage engine and version; test before you run it live.
Third, apply the change in a controlled manner. Use feature flags or deploy migrations in multiple steps for backward compatibility. For example, add the column as nullable first, deploy code that writes to it, backfill data in small batches, then enforce constraints. This prevents downtime for high-traffic systems.