Re: singletons per row in table AND locking response - Mailing list pgsql-general

From Sam Mason
Subject Re: singletons per row in table AND locking response
Date
Msg-id 20090710234650.GQ5407@samason.me.uk
Whole thread Raw
In response to singletons per row in table AND locking response  (Dennis Gearon <gearond@sbcglobal.net>)
List pgsql-general
On Tue, Jul 07, 2009 at 06:45:36PM -0700, Dennis Gearon wrote:
> When locking is involved, does a transaction wait for access to a row
> or table, or does it just fail back to the calling code? Would it be
> up to my PHP code to keep hammeing for access to a row/table, or could
> a user defined function do that?

It defaults to waiting for the lock to be released, but will fail if you
tell it to.  Sounds as though you want to be using row-level locks,
it will allow more concurrency where possible, but table level locks
are also possible.  PG also makes a distinction between "share" locks
(multiple transactions can have a share lock on any table or row) and
"update" locks (this locks out share and other update locks).

--
  Sam  http://samason.me.uk/

pgsql-general by date:

Previous
From: Erik Jones
Date:
Subject: Re: [Fwd: Re: How to trace client sql requests?]
Next
From: "Scot Kreienkamp"
Date:
Subject: Re: Idle in transaction help