- This is the least restrictive lock mode which conflicts only with
+ This is the least restrictive lock mode. It conflicts only with
ACCESS EXCLUSIVE mode. It is intended to protect a table being
modified by concurrent ALTER TABLE,
DROP TABLE and VACUUM
- Automatically acquired by any SELECT FOR UPDATE statement.
- While it is a SHARE lock, there is the intention to later upgrade
+ Automatically acquired by SELECT...FOR UPDATE.
+ While it is a shared lock, there is the intention to later upgrade
this to an EXCLUSIVE lock.
- Automatically acquired by any UPDATE,
- DELETE, INSERT statement.
+ Automatically acquired by UPDATE,
+ DELETE, and INSERT
+ statements.
Conflicts with SHARE, SHARE ROW EXCLUSIVE, EXCLUSIVE and
- ACCESS EXCLUSIVE modes. Generally means that a transaction
- updated or inserted some tuples in a table.
+ ACCESS EXCLUSIVE modes.
- Automatically acquired by any CREATE INDEX statement.
- Share-locks entire table.
+ Automatically acquired by CREATE INDEX.
+ Share-locks the entire table.
SHARE ROW EXCLUSIVE MODE
-
+
- This is like an EXCLUSIVE lock, but allows SHARE ROW locks
+ This is like EXCLUSIVE MODE, but allows SHARE ROW locks
by others.
+
+
+
Conflicts with ROW EXCLUSIVE, SHARE, SHARE ROW EXCLUSIVE,
EXCLUSIVE and ACCESS EXCLUSIVE modes.
EXCLUSIVE MODE
+
+ This mode is yet more restrictive than SHARE ROW EXCLUSIVE.
+ It blocks all concurrent ROW SHARE/SELECT...FOR UPDATE queries.
+
+
+
Conflicts with ROW SHARE, ROW EXCLUSIVE, SHARE, SHARE ROW EXCLUSIVE,
- EXCLUSIVE and ACCESS EXCLUSIVE modes. This mode is yet more
- restrictive than that of SHARE ROW EXCLUSIVE; it blocks all concurrent
- SHARE ROW/SELECT FOR UPDATE queries.
+ EXCLUSIVE and ACCESS EXCLUSIVE modes.
Automatically acquired by ALTER TABLE,
DROP TABLE, VACUUM statements.
+ This is the most restrictive lock mode which conflicts with all other
+ lock modes and protects a locked table from any concurrent operations.
- This is the most restrictive lock mode which conflicts with all other
- lock modes and protects a locked table from any concurrent operations.
-
-
This lock mode is also acquired by an unqualified