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/