Re: SELECT FOR UPDATE NOWAIT - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: SELECT FOR UPDATE NOWAIT
Date
Msg-id 200307231816.h6NIGgp05777@candle.pha.pa.us
Whole thread Raw
In response to Re: SELECT FOR UPDATE NOWAIT  ("Paulo Scardine" <paulos@cimed.ind.br>)
List pgsql-hackers
Paulo Scardine wrote:
> (Excuse my english, my native language is portuguese)
> 
> > I think I'm a quite attentive to the SQL and HACKERS list, and I see
> > requests for a NOWAIT option at least once a month, and it's growing.
> > Regards, Christoph
> 
> Yes. I have done a little google about "pgsql select for update nowait" and
> find lot of people looking for this feature.
> 
> If there is a lock and NOWAIT is specified, then raise error instead of
> waiting for the lock to release. We have some long distance connections that
> get very busy sometimes and is hard to distinguish between network problems
> and locked rows.
> 
> Do you see it as something hard to implement? Any advice?
> Is it just to add an "opt_nowait" to the "FOR UPDATE" clause in the parser
> and checking for this option when trying to get the lock later?

My guess is that we will implement it was a SET variable so it can
control FOR UPDATE/LOCK/UPDATE/DELETE.

Added to TODO:
Add GUC variable to prevent waiting on locks

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Kurt Roeckx
Date:
Subject: Re: Fwd: Re: Possible psql bug
Next
From: "Paulo Scardine"
Date:
Subject: Re: SELECT FOR UPDATE NOWAIT