Re: can we add SKIP LOCKED to UPDATE? - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: can we add SKIP LOCKED to UPDATE?
Date
Msg-id CANP8+j+u02V3RJqRYOKUhVZ4CZE0wNLGmsu282pOh2wz7WevSQ@mail.gmail.com
Whole thread Raw
In response to Re: can we add SKIP LOCKED to UPDATE?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 9 November 2015 at 17:06, Tom Lane <tgl@sss.pgh.pa.us> wrote:
德哥 <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

pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Some questions about the array.
Next
From: Corey Huinker
Date:
Subject: Re: Using quicksort for every external sort run