Re: Concurrency Question

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Perry Smith" <pedz(at)easesoftware(dot)com>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Concurrency Question
Date: 2007-07-17 05:00:59
Message-ID: 87abtvei9g.fsf@oxford.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Perry Smith" <pedz(at)easesoftware(dot)com> writes:

> Looking at the documentation above, I would expect the insert into A to get a
> Row exclusive lock for table A. And, I'm guessing it would get an ACCESS
> SHARE lock for table B. But this would not prevent the delete from B from
> happening at the same time (if I am reading this correctly).

The bit you quoted was for tables. The RI trigger does indeed take a share
lock on the referenced record in table B which prevents it from being deleted.
(In older versions it used to take an exclusive lock because there were no
share locks on records.)

--
Gregory Stark
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jason Nerothin 2007-07-17 07:03:07 interaction with postgres defined types in custom c functions
Previous Message Gregory Stark 2007-07-17 04:56:37 Re: why postgresql over other RDBMS