X-Original-To: pgsql-general-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 370369FA232; Mon, 3 Jul 2006 07:45:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 76768-01; Mon, 3 Jul 2006 07:45:47 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- X-Greylist: from auto-whitelisted by SQLgrey- Received: from obelix.askesis.nl (laudanum.demon.nl [82.161.125.16]) by postgresql.org (Postfix) with ESMTP id CB2CE9FA357; Mon, 3 Jul 2006 07:45:47 -0300 (ADT) Received: obelix 172.31.0.1 from 172.31.1.1 172.31.1.1 via HTTP with MS-WebStorage 6.0.6249 Received: from panoramix by obelix; 03 Jul 2006 12:45:45 +0200 Subject: Is what I want possible and if so how? From: Joost Kraaijeveld To: pgsql-jdbc@postgresql.org, pgsql-general@postgresql.org Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Mon, 03 Jul 2006 12:45:45 +0200 Message-Id: <1151923545.6055.40.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/61 X-Sequence-Number: 97685 Hi, I have a table with events that must be handled by multiple clients. It does not matter which client handles an event, but no two clients may handle the same event and an event may only handled once. A client can only determine the availability of an event by querying the database. The access to the table should be queue-like with synchronization. My idea was that a client should do a "SELECT" on the table and mark the selected records as "being handled" to avoid double handling. I have read the manual about "LOCK", "SET TRANSACTION" and "SELECT...FOR UPDATE", but from what I understand, they cannot prevent a "SELECT" from another client, based on the "SELECT". Is there a way to make this possible? TIA -- Groeten, Joost Kraaijeveld Askesis B.V. Molukkenstraat 14 6524NB Nijmegen tel: 024-3888063 / 06-51855277 fax: 024-3608416 web: www.askesis.nl