X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id ADC5911F65F3 for ; Thu, 20 Apr 2006 19:47:42 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0.287 X-Spam-Level: X-Spam-Status: No, score=0.287 required=5 tests=[AWL=0.287] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id Vhsp93OFfYjA for ; Thu, 20 Apr 2006 19:47:36 -0300 (ADT) 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 486C911F6359 for ; Thu, 20 Apr 2006 19:47:38 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 8D75556423; Thu, 20 Apr 2006 17:47:38 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Thu, 20 Apr 2006 17:47:38 -0500 Date: Thu, 20 Apr 2006 17:47:38 -0500 From: "Jim C. Nasby" To: Mathias Laurent Cc: pgsql-admin@postgresql.org Subject: Re: Problem with SELECT FOR UPDATE NOWAIT Message-ID: <20060420224737.GP49405@pervasive.com> References: 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:060420:e1lauren@hotmail.com::jNZq+X1vw7mkvb83:00000000000000000 0000000000000000000000004rO+ X-Hashcash: 1:20:060420:pgsql-admin@postgresql.org::Fz4KNnVB7hYBLlWd:00000000000 0000000000000000000000001MfM X-Archive-Number: 200604/205 X-Sequence-Number: 21374 I think you're confused about what actually happened... Session 1: decibel=# select * from a; i --- 1 (1 row) decibel=# begin; BEGIN decibel=# select * from a for update nowait; i --- 1 (1 row) decibel=# Session 2: decibel=# select * from a for update nowait; ERROR: could not obtain lock on row in relation "a" decibel=# select * from a for update; ...waits... Session 1: decibel=# rollback; ROLLBACK decibel=# And immediately in session 2: i --- 1 (1 row) decibel=# On Thu, Apr 13, 2006 at 01:57:47AM +0000, Mathias Laurent wrote: > Hello, > > Veiled I have a small problem which I have solved in a way not very clean, > I would thus like to have your opinion. When I made with the process 1 : > > Select * FROM myTable WHERE num=3 FOR UPDATE NOWAIT > > And that I remade it with a process 2 before having do one "Commit" It > blocked me (until there normal) > But once that I free by doing one "Commit" with process 1 All the table > remains to block for process 2... > To have access it, it is necessary that I do one "Commit" with the > processus2 !! It's very strange... > > Thank you, > > Mathias Laurent > > _________________________________________________________________ > Windows Live Mail : d?couvrez et testez la version b?ta ! > http://www.ideas.live.com/ > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq > -- Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com Pervasive Software http://pervasive.com work: 512-231-6117 vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461