- If you’re at PGDay Austria today, don’t miss @apatheticmagpie.bsky.social ’s talk: “Anatomy of Table-Level Locks in PostgreSQL” 🔒 📍 14:10 – 14:55 📍 Room: Sophie 🗓️ Full schedule: pgday.at/schedule/
- In this session, Gülçin will explain how PostgreSQL handles table-level locks, especially those triggered by DDL operations. It all starts with Postgres’ secret weapon: MVCC. MVCC = Multi-Version Concurrency Control. ✅ Reads don’t block writes. ✅ Writes don’t block reads.
- But here’s the catch → MVCC doesn’t protect you from object locks. That’s where things get interesting. 🔑 Key takeaways: MVCC avoids many issues, but DDL still needs strong locks. Each DDL command has its own lock strength, some block both reads and writes.
- ACCESS EXCLUSIVE is the strictest lock, blocking everything. More pro tips: Don’t mix strong-lock DDL with other operations in the same transaction. Use lock_timeout to prevent cascading lock queues + handle retries gracefully. Locks aren’t about security → they’re about concurrency control.Sep 4, 2025 08:47
- If you want to understand Postgres locks beyond the basics, this talk is for you. Catch it today at PGDay Austria! 🔒🐘 📍 14:10 – 14:55 📍 Room: Sophie 🗓️ Full schedule: pgday.at/schedule/