Description
-
- Terms
-
-
-
- EXCLUSIVE
-
- Exclusive lock that prevents other locks from being granted.
-
-
-
-
-
-
-
- SHARE
-
- Allows others to share lock. Prevents EXCLUSIVE locks.
-
-
-
-
-
-
-
- ACCESS
-
- Locks table schema.
-
-
-
-
-
-
-
- ROW
-
- Locks individual rows.
-
-
-
-
-
-
-
- Notes
-
- If EXCLUSIVE or SHARE are not specified, EXCLUSIVE is assumed.
- Locks exist for the duration of the transaction.
-
-
-
-
-
-
+ LOCK TABLE controls concurrent access to a table
+ for the duration of a transaction.
Postgres always uses the least restrictive
lock mode whenever possible. LOCK TABLE
provided for cases when you might need more restrictive locking.
+
RDBMS locking uses the following terminology:
+
+
+
+ EXCLUSIVE
+
+ Exclusive lock that prevents other locks from being granted.
+
+
+
+
+
+ SHARE
+
+ Allows others to share lock. Prevents EXCLUSIVE locks.
+
+
+
+
+
+ ACCESS
+
+ Locks table schema.
+
+
+
+
+
+ ROW
+
+ Locks individual rows.
+
+
+
+
+
+
+ If EXCLUSIVE or SHARE are not specified, EXCLUSIVE is assumed.
+ Locks exist for the duration of the transaction.
+
+
+
+
For example, an application runs a transaction at READ COMMITTED isolation
level and needs to ensure the existance of data in a table for the