Implementing queue semantics (novice) - Mailing list pgsql-sql

From KÖPFERL Robert
Subject Implementing queue semantics (novice)
Date
Msg-id ED4E30DD9C43D5118DFB00508BBBA76EB1653E@neptun.sonorys.at
Whole thread Raw
Responses Re: Implementing queue semantics (novice)  (Andrew Hammond <ahammond@ca.afilias.info>)
List pgsql-sql
Hi,

since I am new to writing stored procedures I'd like to ask first bevore I
do a mistake.

I want to implement some kind of queue (fifo). There are n users/processes
that add new records to a table and there are m consumers that take out
these records and process them.
It's however possible for a consumer to die or loose connection while
records must not be unprocessed. They may rather be processed twice.

This seems to me as a rather common problem. But also with atomicy-holes to
fall into.
How is this commonly implemented?


I can imagine an 'add' and a 'get' function together with one aditional
'processed' timestamp-column?



Thanks for helping me do the right.


pgsql-sql by date:

Previous
From: sad
Date:
Subject: Re: Single row tables
Next
From: Andrew Hammond
Date:
Subject: Re: Implementing queue semantics (novice)