Re: Multithreaded queue in PgSQL - Mailing list pgsql-general

From Dimitri Fontaine
Subject Re: Multithreaded queue in PgSQL
Date
Msg-id 200806101254.57397.dfontaine@hi-media.com
Whole thread Raw
In response to Multithreaded queue in PgSQL  (Nikola Milutinovic <alokin1@yahoo.com>)
List pgsql-general
Le mardi 10 juin 2008, Nikola Milutinovic a écrit :
> Suppose we have one table in PgSQL which is a job queue, each row
> represents one job with several status flags, IDs,... Several processes
> will attempt to access the queue and "take" their batch of jobs, the batch
> will have some parameterizable size. So, the simple idea is "select N
> lowest IDs that do not have a flag <in process> set and set the flag",
> "then proceed with whatever it is that should be done".

You may find that the PGQ component of skytools is what you want:
  http://pgfoundry.org/projects/skytools
  http://skytools.projects.postgresql.org/doc/
  http://skytools.projects.postgresql.org/doc/pgq-sql.html

And there's even a nice and recent presentation paper about it:
  http://www.pgcon.org/2008/schedule/events/79.en.html

And a less recent but still useful blog entry on the subject:

http://kaiv.wordpress.com/2007/10/19/skytools-database-scripting-framework-pgq/

Regards,
--
dim

Attachment

pgsql-general by date:

Previous
From:
Date:
Subject: Re: Insert into master table ->" 0 rows affected" -> Hibernate problems
Next
From: IPS
Date:
Subject: Query on Oracle 10g Merge Function equivalent command/function in Postgre