Re: New to concurrency - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: New to concurrency
Date
Msg-id 20070407111341.GA28829@svana.org
Whole thread Raw
In response to New to concurrency  ("John D. Burger" <john@mitre.org>)
List pgsql-general
On Fri, Apr 06, 2007 at 08:03:42PM -0400, John D. Burger wrote:
> For the first time, I find myself wanting to use some of PG's
> concurrency control stuff, and I could use some advice.
>
> I have requests showing up in a database, and I have one or more
> servers picking these up with listen/notice.  The requests go into a
> table with a status column, which is initially NULL, so a server
> finds requests to process like so:

There's been some discussion about this earlier on these list, I
suggest you try google. In any case, from memory the issues are as
follows:

1. SELECT FOR UPDATE is enough, except you have to handle the case that
sometimes the query will return no rows even though there is work to
do.
2. If you have multiple programs reading the queue, they will conflict
with eachother, various ways were described to handle that.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: performance; disk bad or something?
Next
From: Marcus Engene
Date:
Subject: Re: performance; disk bad or something?