doc: clarify when row-level locks are released
authorBruce Momjian
Tue, 31 Mar 2020 21:27:32 +0000 (17:27 -0400)
committerBruce Momjian
Tue, 31 Mar 2020 21:27:32 +0000 (17:27 -0400)
They are released just like table-level locks.  Also clean up wording.

Reported-by: [email protected]
Discussion: https://postgr.es/m/158074944048.1095.4309647363871637715@wrigleys.postgresql.org

Backpatch-through: 9.5

doc/src/sgml/mvcc.sgml

index 24613e3c75401a79cf40f240b742d838858cd987..25f0660467186d0c0a743a60f74dbd1acdb42e7f 100644 (file)
@@ -1039,9 +1039,9 @@ ERROR:  could not serialize access due to read/write dependencies among transact
      
 
    
-    Once acquired, a lock is normally held till end of transaction.  But if a
+    Once acquired, a lock is normally held until the end of the transaction.  But if a
     lock is acquired after establishing a savepoint, the lock is released
-    immediately if the savepoint is rolled back to.  This is consistent with
+    immediately if the savepoint is rolled back.  This is consistent with
     the principle that ROLLBACK cancels all effects of the
     commands since the savepoint.  The same holds for locks acquired within a
     PL/pgSQL exception block: an error escape from the block
@@ -1178,7 +1178,10 @@ ERROR:  could not serialize access due to read/write dependencies among transact
      conflicting locks on the same row, even in different subtransactions;
      but other than that, two transactions can never hold conflicting locks
      on the same row.  Row-level locks do not affect data querying; they
-     block only writers and lockers to the same row.
+     block only writers and lockers to the same
+     row.  Row-level locks are released at transaction end or during
+     savepoint rollback, just like table-level locks.
+