Zeilensperren in PostgreSQL: eine anatomische Betrachtung

The anatomy of PostgreSQL row locks
Thursday, June 25 at 11:20–12:10
  • PostgreSQL contributor, senior database engineer and maintainer of oracle_fdw and pgreplay.

Category: General Level: Intermediate Language: DE Room: 3.010

Zeilensperren (row locks) kennt ohnehin jeder, oder? Sie verhindern Konflikte bei Datenänderungen, und man setzt sie mit UPDATE, DELETE und SELECT ... FOR UPDATE.

Dieser Vortrag zeigt, dass es über Zeilensperren noch viel mehr zu wissen gibt:

  • Welche Grade von Zeilensperren gibt es und wozu sind sie gut?
  • Wie verwendet PostgreSQL Zeilensperren, um die Konsistenz von Fremdschlüsseln zu wahren?
  • Wo speichert PostgreSQL Zeilensperren?
  • Wie kann man bestehende Zeilensperren auf einer Tabelle untersuchen?
  • Wie schauen Zeilensperren in pg_locks aus?
  • Was zum Teufel ist ein "MultiXact", wozu ist es gut, und was hat es mit Zeilensperren zu tun?

Wer eine transaktionsintensive PostgreSQL-Datenbank entwickelt oder betreut, sollte diese Dinge wissen.


Everybody knows about row locks, right? They prevent conflicts during data modifications, and you take them with UPDATE, DELETE and SELECT ... FOR UPDATE.

This talk will show you that there is more to know about row locks:

  • What lock levels are there and what is their purpose?
  • How does PostgreSQL use row locks to maintain foreign key consistency?
  • How does PostgreSQL store row locks?
  • How can you inspect row locks on a table?
  • How do row locks look in pg_locks?
  • What the hell are MultiXacts, what are they good for, and what do they have to do with row locks?

Whoever maintains or develops a highly transactional PostgreSQL database should know these things.

Back

Join Us For Swiss PGDay 2026

25 & 26 June 2026

Rapperswil, Switzerland