Skip site navigation (1) Skip section navigation (2)

SELECT FOR UPDATE NOWAIT

From: "Mathias Laurent" <e1lauren(at)hotmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: SELECT FOR UPDATE NOWAIT
Date: 2006-09-28 15:26:36
Message-ID: BAY112-F69231CB85D5278395F9F19A1B0@phx.gbl (view raw or flat)
Thread:
Lists: pgsql-admin
If I do :
Session 1:
decibel=# begin;
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 !

_________________________________________________________________
Windows Live Messenger sur i-modeĀ™ : dialoguez avec vos amis depuis votre 
mobile comme sur PC ! http://mobile.live.fr/messenger/bouygues/


In response to

Responses

pgsql-admin by date

Next:From: Bruce MomjianDate: 2006-09-28 16:32:33
Subject: Re: What Are Last Steps Performed When PostgreSQL
Previous:From: Chris HooverDate: 2006-09-28 15:10:46
Subject: Table Truncate and Locks

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group