Re: SELECT FOR UPDATE NOWAIT

From: "Paulo Scardine" <paulos(at)cimed(dot)ind(dot)br>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SELECT FOR UPDATE NOWAIT
Date: 2003-07-23 20:15:10
Message-ID: 01cb01c35157$1e038e60$63000a0a@cimed.ind.br
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

LockAcquire has a "dontWait" parameter, which do just what I want.

The executor level calls "heap_open(relid, RowShareLock)" when doing "FOR
UPDATE"s.
Should we define something like RowShareLockNoWait, so heap_open() or other
lower level functions can call LockAcquire() with dontWait set?

By the way, is this kind of question on-topic for pgsql-hackers?

TIA,
--
Paulo Scardine

----- Original Message -----
From: "Bruce Momjian" <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Paulo Scardine" <paulos(at)cimed(dot)ind(dot)br>; <pgsql-hackers(at)postgresql(dot)org>
Sent: Wednesday, July 23, 2003 4:30 PM
Subject: Re: [HACKERS] SELECT FOR UPDATE NOWAIT

> Tom Lane wrote:
> > "Paulo Scardine" <paulos(at)cimed(dot)ind(dot)br> writes:
> > > - Where is the best place to put this?
> >
> > I think it would be a really *bad* idea to put it in LockAcquire; that
> > risks breaking things that you don't want broken.
> >
> > Whether it's special syntax or a GUC variable, the restriction should
> > only apply to SELECT FOR UPDATE row locks, perhaps user-commanded LOCK
> > TABLE operations, and maybe one or two other places that are known to
> > be used only for user-written operations and not for system-initiated
> > ones. Those places would need to check whether to do a conditional
> > or unconditional lock.
>
> My original idea was to have it apply only for exclusive locks. It
> seemed those were mostly the locks didn't want to wait for. Shared
> locking pg_class is something that you would want to wait for.
>
> --
> Bruce Momjian | http://candle.pha.pa.us
> pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
> + If your life is a hard drive, | 13 Roberts Road
> + Christ can be your backup. | Newtown Square, Pennsylvania
19073
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com)
Version: 6.0.490 / Virus Database: 289 - Release Date: 16/6/2003

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Treat 2003-07-23 20:20:20 Re: Feature request -- Log Database Name
Previous Message Mike Mascari 2003-07-23 19:53:01 Re: how do i turn off the html tags??