Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 0C6949FB255 for ; Thu, 28 Sep 2006 16:23:29 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 92227-06 for ; Thu, 28 Sep 2006 19:23:20 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id 00A729FB20B for ; Thu, 28 Sep 2006 16:23:19 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id CA8C956435; Thu, 28 Sep 2006 14:23:18 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Thu, 28 Sep 2006 14:23:17 -0500 Date: Thu, 28 Sep 2006 14:23:17 -0500 From: "Jim C. Nasby" To: Mathias Laurent Cc: pgsql-admin@postgresql.org Subject: Re: SELECT FOR UPDATE NOWAIT Message-ID: <20060928192317.GY34238@nasby.net> References: <1d219a6f0609280810j5e156f33uaafbb37c17ee5d5d@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 6.0-RELEASE-p4 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.11 X-Hashcash: 1:20:060928:e1lauren@hotmail.com::cxyV8f2N03tH+qYJ:00000000000000000 0000000000000000000000002V+N X-Hashcash: 1:20:060928:pgsql-admin@postgresql.org::ZG/oYuGbbkvLaN1H:00000000000 000000000000000000000000A4mP X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200609/342 X-Sequence-Number: 23256 On Thu, Sep 28, 2006 at 03:26:36PM +0000, Mathias Laurent wrote: > If I do : > Session 1: > decibel=# begin; Does decibel have some meaning in some language other than english? > BEGIN > decibel=# select * from i where i=1 for update nowait; > i > --- > 1 > (1 row) > > decibel=# begin; > BEGIN > decibel=# select * from i where i=2 for update nowait; > i > --- > 2 > (1 row) > > Session 2 : > > decibel=# select * from i where i=1 for update nowait; > ERROR: could not obtain lock on row in relation "i" > decibel=# select * from i where i=3 for update nowait; > ERROR: current transaction is aborted, commands ignored until end of > transaction block > decibel=# ==> Why ? :'( > > Why i can't do any "Select for update" (current transaction aborted) after > having receive a not obtain lock ??? > Thank you for your answer ! Because as soon as there is an error in a transaction, the entire transaction is void. You have to rollback the transaction (or return to a savepoint). -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)