Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 742454758C9 for ; Sun, 19 Jan 2003 16:23:50 -0500 (EST) Received: from davinci.ethosmedia.com (unknown [209.10.40.251]) by postgresql.org (Postfix) with ESMTP id B976647580B for ; Sun, 19 Jan 2003 16:23:49 -0500 (EST) Received: from [66.219.92.2] (HELO chocolate-mousse) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 2319131; Sun, 19 Jan 2003 13:23:54 -0800 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Reply-To: josh@agliodbs.com Organization: Aglio Database Solutions To: Kurt Roeckx , pgsql-sql@postgresql.org Subject: Re: Selecting a non-locked row. Date: Sun, 19 Jan 2003 13:26:10 -0800 X-Mailer: KMail [version 1.4] References: <20030119133320.GA3984@ping.be> In-Reply-To: <20030119133320.GA3984@ping.be> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200301191326.10285.josh@agliodbs.com> X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/287 X-Sequence-Number: 11152 Kurt, > I'm in the process of writing an application, and I'm not sure > how to properly solve it. >=20 > 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. >=20 > 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. >=20 > Is there a way to select a row that is not locked yet? I'm a bit confused by your question. Could you try explaining it another w= ay,=20 possibly with SQL code examples? --=20 -Josh Berkus Aglio Database Solutions San Francisco