I have a typical producer-consumer problem:
Multiple producer applications write job requests to a job-table on a PostgreSQL database.
The job requests have
Read my post here:
Consistency in postgresql with locking and select for update
If you use transaction and LOCK TABLE you will have no problems.