Renaming a column without downtime: expand, migrate, contract
ALTER TABLE ... RENAME COLUMN takes a millisecond and breaks every running pod. A step-by-step expand and contract rename in Postgres, with the trigger we use.
Topic · 4 stories
Indexes, query plans, migrations and the locks behind them, written from the point of view of the team that owns the database.
ALTER TABLE ... RENAME COLUMN takes a millisecond and breaks every running pod. A step-by-step expand and contract rename in Postgres, with the trigger we use.
For most teams, feature flags are a Postgres table, a hashing function and a policy about expiry dates. Here is ours, and when we would pay for a product instead.
We added an index to fix a 1.2 second query and the plan did not change. Here is how EXPLAIN ANALYZE told us why, and the partial index that worked.
Webhook providers deliver at least once, so your handler will see duplicates. A unique key and one transaction in Postgres make that harmless.