Does Postgresql apply the same type of locks on
UPDATE with a range condition and on
UPDATE with in-set condition?
E.g. will the queries:
UPDATE table WHERE id IN (1,2,3,4,5,6,7,8,9,10);
UPDATE table WHERE id >= 1 AND id < 11;
Cause the same type of locks on
Yes, both statements will take a
UPDATE lock on all the modified rows.
FOR UPDATElock mode is also acquired by any
DELETEon a row, and also by an
UPDATEthat modifies the values on certain columns.