Re: Foreign key order evaluation

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Randy Yates <yates(at)ieee(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Foreign key order evaluation
Date: 2004-09-29 00:51:51
Message-ID: 20040929005151.GA6475@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 28, 2004 at 10:27:21PM +0000, Randy Yates wrote:

> I see the light. You mean it would be nice to be able to have a "LOCK-FOR-UPDATE-ONLY"
> lock as well as a "LOCK-FOR-UPDATE-OR-READ" lock, but all you have now is
> "LOCK-FOR-UPDATE-OR-READ" and that gets applied even when you don't care if
> someone else reads the record?

Right. The current implementation acquires an exclusive lock (FOR
UPDATE -- what you're referring to as LOCK-FOR-UPDATE-OR-READ); it
would be nice to have a lock that could be shared so multiple
transactions could acquire it at the same time without blocking.
Then all transactions could read the foreign key record, but no
transaction could modify it until the other transactions completed
and released their locks.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Russell Smith 2004-09-29 01:13:12 Re: Controlling order of evaluation?
Previous Message Scott Marlowe 2004-09-29 00:37:50 Re: doubt about the database