Re: using database for queuing operations?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mark Harrison <mh(at)pixar(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: using database for queuing operations?
Date: 2004-09-20 23:07:50
Message-ID: 22870.1095721670@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Mark Harrison <mh(at)pixar(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jaime Casanova 2004-09-20 23:18:52 Re: unique constraints on foreign keys
Previous Message David Helgason 2004-09-20 23:00:41 Re: Any reason not to use inheritance?