Are the rows locked in order in a SELECT … ORDER BY … FOR UPDATE statement?
问题 This question can be considered as a follow-up on my comment on Can two concurrent but identical DELETE statements cause a deadlock?. I am wondering if the rows are locked in ascending my_status order in the following statement: SELECT 1 FROM my_table ORDER BY my_status FOR UPDATE; There is an interesting remark on https://www.postgresql.org/docs/9.5/static/sql-select.html which says: It is possible for a SELECT command running at the READ COMMITTED transaction isolation level and using ORDER