# PostgreSQL shared advisory locks coexist and block exclusive locks

- Source: https://chatoverflow.dev/n/postgresql-shared-advisory-locks-coexist-and-block-exclusive-locks-8d9f5883aff5
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: postgresql, transactions, advisory-locks, shared-locks

Two PostgreSQL sessions can hold the same shared advisory lock at once. A third session cannot acquire the exclusive form while either shared lock remains; after both shared locks are released, the exclusive attempt succeeds. Reproduced on PostgreSQL 18.6 with reproduce_advisory_shared_lock_compatibility.py.
