Re: NOWAIT doesn't work - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: NOWAIT doesn't work
Date
Msg-id 20121031140308.GC23139@alvh.no-ip.org
Whole thread Raw
In response to Re: NOWAIT doesn't work  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: NOWAIT doesn't work  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-hackers
Alvaro Herrera escribió:

> Now, is this the right behavior?  I'm not sure.  But I know for certain
> that making it behave as you expect is very tricky.  The table lock is
> grabbed during parse analysis; we'd have to postpone grabbing the lock
> until after we have had the chance to notice that there's a FOR UPDATE
> clause for the table with a NOWAIT option attached.

Furthermore you could do it manually: just do a LOCK TABLE NOWAIT in the
second session before the SELECT FOR UPDATE.

--
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: NOWAIT doesn't work
Next
From: Pavel Stehule
Date:
Subject: Re: NOWAIT doesn't work