A new column changes more than the table. It touches queries, indexes, migrations, APIs, and sometimes deployment orders. Get it wrong and you ship broken code or stall the pipeline. Get it right and the database evolves without pain.
Adding a new column starts with the migration. In PostgreSQL, ALTER TABLE ... ADD COLUMN is straightforward, but you need to know the defaults, nullability, and constraints before running it in production. Large tables can lock writes during the schema change, so schedule the operation when load is low or use tools that allow online migration.
After the schema update, review all dependent SQL statements. SELECTs might need to include the new column. INSERTs and UPDATEs must set it correctly or handle defaults. ORM models require field definitions to match the database, or runtime errors will follow.
Indexes matter. If the new column is part of a frequent filter or join, create the right index to maintain performance. Watch the size of composite indexes; they can slow down writes.
Data backfill is often the most expensive step. Decide if you populate the column in a single transaction or in batches to avoid locking. For immutable history tables, backfilling may need temporary maintenance mode.