What's the worst deploy-time lock you've hit?
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
原文:https://www.a8q9.cn/en/article/what-s-the-worst-deploy-time-lock-you-ve-hit-56e150.html