↑↓ select ↵ open ⌫ change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

Reference / Lock Modes / Table lock

Table lock · AS

ACCESS SHARE

Current

Definition

Conflicts with the ACCESS EXCLUSIVE lock mode only.

The SELECT command acquires a lock of this mode on referenced tables. In general, any query that only reads a table and does not modify it will acquire this lock mode.

Compatibility

Compare different transactions holding locks on the same table.

View the full compatibility matrices

Commands acquiring this mode

SQL commandObject, phase and conditions
SELECTRead referenced tables without a FOR locking clause. Source
COPY … TORead the source table. COPY (query) TO follows the locks required by that query. Source
LOCK TABLE … IN ACCESS SHARE MODERequest this table mode explicitly. Omitting IN MODE defaults to ACCESS EXCLUSIVE. Source
ALTER TABLE … NO INHERIT (parent table)Take ACCESS SHARE on the parent while removing inheritance. The altered child separately takes 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

Source collection date: 2026-09-27.