Re: using database for queuing operations? - Mailing list pgsql-general

From Tom Lane
Subject Re: using database for queuing operations?
Date
Msg-id 22870.1095721670@sss.pgh.pa.us
Whole thread Raw
In response to using database for queuing operations?  (Mark Harrison <mh@pixar.com>)
Responses Re: using database for queuing operations?  (Mark Harrison <mh@pixar.com>)
List pgsql-general
Mark Harrison <mh@pixar.com> writes:
> It would be really great if I could handle this without the front end
> program, so that multiple programs could do something like the following:

>      select next image to be processed (with above select logic)
>      process the image
>      delete the row for that image

> I think that I can use "select for update" to obtain a write lock (so that
> I can safely delete the row when finished), but I'm unsure if it's possible
> to avoid the race condition where two processes would get the same row.

See the archives; this has been discussed in great detail before
(several times before, if memory serves).

            regards, tom lane

pgsql-general by date:

Previous
From: David Helgason
Date:
Subject: Re: Any reason not to use inheritance?
Next
From: Mark Harrison
Date:
Subject: Re: using database for queuing operations?