Runbook category

Schema migrations

Open this category when the change is a deploy, not a query. A migration window, a column type change, a constraint, a partition attach, or a CREATE INDEX that has to finish without taking the site down. Most migration outages are lock outages, not data outages, and they start from a DDL statement that looked harmless in staging.

The pattern repeats: a statement wants ACCESS EXCLUSIVE, waits behind one long reader, and every query arriving after it queues too. These runbooks show the non-blocking form of each change, NOT NULL without a full rewrite, NOT VALID then VALIDATE for CHECK constraints, CONCURRENTLY for indexes, detach and attach for partitions, filenode checks when you need to know whether a rewrite already happened. And how to recover when CREATE INDEX CONCURRENTLY fails halfway and leaves an invalid index behind.

Locking & concurrency is the runtime wait-graph skill you need when a migration is already stuck. Indexing is which index to add; this category is how to add or validate schema without a multi-hour outage. If the incident is an app deploy and the table is the blast radius, you are in the right place.