德哥 <digoal@126.com> writes: > PostgreSQL 9.5 added skip locked to select for update to improve concurrency performance, but why not add it to update sql?
Seems like you'd have unpredictable results from the update then.
True, but given the already restricted use case of SKIP LOCKED, the request makes sense for the following
UPDATE ...
SKIP LOCKED
RETURNING xxx
would be better than
BEGIN
SELECT xxx
FOR UPDATE
SKIP LOCKED
UPDATE
COMMIT
--
Simon Riggs http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services