Adding a new column seems simple until production traffic is on the line. Schema changes can lock tables, block writes, or trigger downtime if done without planning. The right workflow makes the difference between a clean deploy and an outage.
A new column starts with definition. Choose the exact data type. In PostgreSQL, use the narrowest type required to reduce storage and speed up queries. Decide if it should allow NULL or require a default value. Be careful with defaults on large tables — adding them inline can rewrite the whole table, causing delays.
Next, stage the change. Add the new column in one migration without constraints or heavy processing. Backfill data in small, controlled batches to avoid locking. Only after the column is populated and verified should you add indexes or foreign keys.