I'm bulk updating some rows using UPDATE ... FROM (values ...
as described in this answer.
Will the rows will be locked in the order that they appear in the values? Or do I need to do an explicit SELECT FOR UPDATE
first?
Here's an example statement
UPDATE stats as t set "individualCount" = new_values."individualCount"
FROM (values (6::int,7::int),(3::int,15::int))
as new_values("individualCount","id")
WHERE new_values."id" = t."id"
(id is the primary key of the table)