Re: SKIP LOCKED DATA (work in progress) - Mailing list pgsql-hackers

From David Rowley
Subject Re: SKIP LOCKED DATA (work in progress)
Date
Msg-id CAApHDvp=9ZcnKp1BnBoFQsaJf7_0N3M1J9WY=+n-n97HwOeXOA@mail.gmail.com
Whole thread Raw
In response to Re: SKIP LOCKED DATA (work in progress)  (Thomas Munro <munro@ip9.org>)
Responses Re: SKIP LOCKED DATA (work in progress)
List pgsql-hackers
On Sat, Aug 2, 2014 at 3:55 AM, Thomas Munro <munro@ip9.org> wrote:
On 1 August 2014 10:37, David Rowley <dgrowleyml@gmail.com> wrote:
> Apart from this I can't see any other problems with the patch and I'd be
> very inclined, once the above are fixed up to mark the patch ready for
> commiter.
>
> Good work

Thanks for all the guidance, I appreciate it!  My review karma account
is now well overdrawn.

Ok, then I have nothing more so it's time to pass this one along.

The only notes I can think to leave for the commiter would be around the precedence order of the lock policy, especially around a query such as:

SELECT * FROM (SELECT * FROM a FOR UPDATE SKIP LOCKED) a FOR UPDATE; -- skip locked wins

Of course the current behaviour is that NOWAIT wins over the standard FOR UPDATE, but with NOWAIT, there's only a chance of an error, there's no chance of giving incorrect results. 

I checked what Oracle did in this situation and I see that they completely disallow FOR UPDATE inside of views and subqueries.

I could see an argument here that the outer most FOR UPDATE clause should be used, but I guess that ship has sailed when NOWAIT was added.

Marking as ready for commiter.

Regards

David Rowley

pgsql-hackers by date:

Previous
From: David G Johnston
Date:
Subject: Re: Proposed changing the definition of decade for date_trunc and extract
Next
From: Josh Berkus
Date:
Subject: Re: Re: Proposed changing the definition of decade for date_trunc and extract