Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id F3B62475B84 for ; Sun, 19 Jan 2003 08:33:17 -0500 (EST) Received: from tartarus.telenet-ops.be (tartarus.telenet-ops.be [195.130.132.34]) by postgresql.org (Postfix) with ESMTP id 6E0B8475B47 for ; Sun, 19 Jan 2003 08:33:17 -0500 (EST) Received: from localhost (localhost.localdomain [127.0.0.1]) by tartarus.telenet-ops.be (Postfix) with SMTP id 9E3CEDCC0F for ; Sun, 19 Jan 2003 14:33:20 +0100 (CET) Received: from kabel.telenet.be (D5775F15.kabel.telenet.be [213.119.95.21]) by tartarus.telenet-ops.be (Postfix) with ESMTP id 6A31EDCD16 for ; Sun, 19 Jan 2003 14:33:20 +0100 (CET) Received: by kabel.telenet.be (Postfix, from userid 501) id 2BCF026132; Sun, 19 Jan 2003 14:33:20 +0100 (CET) Date: Sun, 19 Jan 2003 14:33:20 +0100 From: Kurt Roeckx To: pgsql-sql@postgresql.org Subject: Selecting a non-locked row. Message-ID: <20030119133320.GA3984@ping.be> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/286 X-Sequence-Number: 11151 I'm in the process of writing an application, and I'm not sure how to properly solve it. I have a table with records in, and they either still need to be processed or not. Several people will be using the table at the same time. I was thinking about using a select .... for update limit 1, but the other persons will of course try to select the same record and wait until that one is released. The locks are held for a long period of time. Is there a way to select a row that is not locked yet? Kurt