Changes between Initial Version and Version 1 of Ticket #27193, comment 2


Ignore:
Timestamp:
Sep 7, 2016, 9:26:53 PM (8 years ago)
Author:
sqwishy

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #27193, comment 2

    initial v1  
    1 The documentation at the following link may suggest that rows are locked while a query is running rather than all at once atomically; see particularly the second paragraph under "13.2.1. Read Committed Isolation Level" https://www.postgresql.org/docs/current/static/transaction-iso.html#XACT-READ-COMMITTED
     1Replying to [comment:1 shaib]:
     2>As far as I know, the locking is atomic -- it is done for all rows matching the criteria together, and thus the order-by clause on the inner select is indeed meaningless and can be dropped.
     3How would you get deadlocks with updates if that were the case?
     4
     5I can't find where the documentation explicitly states that locking is done row-by-row. Depending on how you read it, the information at the following link may suggest that rows are locked while a query is running rather than all at once atomically. See particularly the second paragraph under "13.2.1. Read Committed Isolation Level". https://www.postgresql.org/docs/current/static/transaction-iso.html#XACT-READ-COMMITTED
    26
    37This is a bit of code where adding the order by seems to prevent deadlocks.
Back to Top