Search Postgresql Archives

Re: New to concurrency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux