Adding a new column is one of the most common database schema changes. Done right, it is fast, safe, and easy to deploy. Done wrong, it can lock tables, trigger downtime, or corrupt data. Whether you are working in PostgreSQL, MySQL, or a cloud data warehouse, the steps are simple but unforgiving.
A new column begins with definition. Choose the column name, type, and nullability. Decide if it needs a default value. If you apply a default to a large table with a NOT NULL constraint, the database may rewrite the entire table. This can block reads and writes for seconds or hours depending on size. To avoid this, add the column as nullable, backfill in small batches, then apply the constraint.
In PostgreSQL, ALTER TABLE ADD COLUMN is the command. On smaller datasets it runs instantly. On large production tables, the safest method is to add the new column without constraints, populate it in a controlled migration job, then alter it again to enforce rules. This pattern avoids long locks and improves deploy reliability.