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

From Jim C. Nasby
Subject Re: using database for queuing operations?
Date
Msg-id 20040920203957.GG1297@decibel.org
Whole thread Raw
In response to Re: using database for queuing operations?  (Jeff Amiel <jamiel@istreamimaging.com>)
List pgsql-general
On Mon, Sep 20, 2004 at 03:08:29PM -0500, Jeff Amiel wrote:
> Add a column to the nameq table designating the 'state' of the image.
> Then your logic changes to "select * from nameq where serial = (select
> min(serial) from nameq) and state="UNPROCESSED" (or whatever)
> So you select for update, change the state, then process the
> image....then delete.
> Viola!

You should also consider what happens if the conversion program can't
update the state to processed for some reason. For example, pgsql might
get shutdown unexpectedly, or the conversion process could.
--
Jim C. Nasby, Database Consultant               decibel@decibel.org
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

pgsql-general by date:

Previous
From: Mark Harrison
Date:
Subject: Re: using database for queuing operations?
Next
From: Jeff Amiel
Date:
Subject: Re: using database for queuing operations?