Re: Feature: FOR UPDATE SKIP LOCKED - Mailing list pgsql-general

From Craig Ringer
Subject Re: Feature: FOR UPDATE SKIP LOCKED
Date
Msg-id 4874759C.7050801@postnewspapers.com.au
Whole thread Raw
In response to Re: Feature: FOR UPDATE SKIP LOCKED  (Csaba Nagy <nagy@ecircle-ag.com>)
Responses Re: Feature: FOR UPDATE SKIP LOCKED
List pgsql-general
Csaba Nagy wrote:
> On Wed, 2008-07-09 at 00:48 -0400, Tom Lane wrote:
>> "Jonathan Bond-Caron" <jbondc@gmail.com> writes:
>>> It would be quite useful to implement a database queue. Although FOR UPDATE
>>> NOWAIT and trying again can work as well as other techniques,
>>> just skipping over the locks has its advantages (simplicity and zero wait)
>> And disadvantages, such as complete lack of predictability or failure
>> detection.
>
> Well, it's not like SQL is completely predictable in general... think
> about ordering of results. Such a feature would definitely help queue
> like table processing, and the fact that it is predictably unpredictable
> should not be a surprise for anybody using such a feature...

Especially if it returned an updated row count or supported the
RETURNING clause, so you could find out after the fact what was or
wasn't done.

--
Craig Ringer

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: plpgsql - or operator?
Next
From: Richard Huxton
Date:
Subject: Re: Getting source code for database objects