Glossary — in plain language

Heavyweight lock (lock manager)

Also called: heavyweight lock manager, object lock, LOCK/PROCLOCK

In plain English

The heavyweight lock manager (lock.c) handles locks on database objects — mostly relations — in eight modes from AccessShareLock (taken by every SELECT) up to AccessExclusiveLock (taken by most DDL). It stores a LOCK per object and a PROCLOCK per holder in a shared table split into 16 partitions to reduce contention.

Why it matters

This is the manager that serialises DML against DDL: a long-running query holding AccessShareLock can block an ALTER TABLE that wants AccessExclusiveLock, and vice versa. It is distinct from lightweight locks (LWLocks, which protect in-memory structures) and from row locks (stored in the tuple, not here).

Was this helpful?

← Browse the full glossary