Reference / Lock Modes / Table lock
Table lock · S
SHARE
Definition
Conflicts with the ROW EXCLUSIVE, SHARE UPDATE EXCLUSIVE, SHARE ROW EXCLUSIVE, EXCLUSIVE, and ACCESS EXCLUSIVE lock modes. This mode protects a table against concurrent data changes.
Acquired by CREATE INDEX (without CONCURRENTLY).
Compatibility
Compare different transactions holding locks on the same table.
· Compatible modes
Commands acquiring this mode
| SQL command | Object, phase and conditions |
|---|---|
| CREATE INDEX (without CONCURRENTLY) | Lock the indexed table, preventing concurrent writes. Source |
| REINDEX (parent table) | Ordinary REINDEX takes SHARE on the table and ACCESS EXCLUSIVE on the index itself. The index lock is not an ACCESS EXCLUSIVE lock on the whole table. Source |
| LOCK TABLE … IN SHARE MODE | Request this table mode explicitly. Omitting IN MODE defaults to ACCESS EXCLUSIVE. Source |
Commands may acquire additional locks. See all command associations.
Other lock modes
Sources
PostgreSQL 18 · Sampled build REL_18_STABLE · 753057e340da. Conflicts, definitions and command associations refer to this fixed source build. SQL links retain the selected version.
Local English manual · Online manual
Pinned source files
- Manual source: explicit locking 753057e340da
- Table lock conflict definitions 753057e340da
- Row lock mode definitions 753057e340da
Source collection date: 2026-09-27.