From: | Martijn van Oosterhout <kleptog(at)svana(dot)org> |
---|---|
To: | "John D(dot) Burger" <john(at)mitre(dot)org> |
Cc: | Postgres General <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: New to concurrency |
Date: | 2007-04-07 11:13:41 |
Message-ID: | 20070407111341.GA28829@svana.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.
From | Date | Subject | |
---|---|---|---|
Next Message | Klaas Dellschaft | 2007-04-07 11:18:40 | Problem with copying data |
Previous Message | Michael Fuhr | 2007-04-07 08:41:37 | Re: performance; disk bad or something? |