Advertisement

All Stories

665 results
645-deploy-migration-locked-table-expand-contract
Databases Bug Report

Deploy migration rewrote a Postgres table and blocked all writes

Samuel Osei · Nov 30, 2026 · 9 min read

A routine deploy changed an integer column to bigint. Postgres rewrote the 90-million-row table under an ACCESS EXCLUSIVE lock and every write to orders queued for 14 minutes. We rebuilt the change as expand and contract with a trigger, batched backfill, lock_timeout and a separate migration step.

Advertisement