Menu

1 / 2

What's the worst deploy-time lock you've hit?

DEV Community: postgres·Bedirhan Elibol·20 days ago
#u2QALdpx
#devtopostgresql#devto#dev#migration#create
Reading 0:00
15s threshold

Bedirhan Elibol

I've seen a two-second migration freeze a checkout page because a plain CREATE INDEX held a lock on a table with a few million rows. Staging never showed it, because staging had a few hundred rows.

What was yours? Curious which statements bit people most: CREATE INDEX, SET NOT NULL, adding a column with a volatile default, something with foreign keys?

I wrote up the three I see most often with the safe versions, if useful: https://zelsis.com/guides/postgres-migration-locks