Re: referential Integrity and SHARE locks - Mailing list pgsql-hackers

From Gregory Stark
Subject Re: referential Integrity and SHARE locks
Date
Msg-id 873b5ivog3.fsf@stark.xeocode.com
Whole thread Raw
In response to Re: referential Integrity and SHARE locks  (Marc Munro <marc@bloodnok.com>)
Responses Re: referential Integrity and SHARE locks  (Marc Munro <marc@bloodnok.com>)
List pgsql-hackers
"Marc Munro" <marc@bloodnok.com> writes:

> Proposal 1: Alter the way RI triggers fire, so that they complete before
> locking the row against which they fire.

It's kind of hard to know what records the user will choose to update before
he actually does the update...

> Proposal 2: Lock the index associated with the parent record, rather
> than the parent record itself.  

That doesn't help in our case because each version of a record has an index
entry. So even updates to unrelated fields imply index modifications. Worse,
deleting and updating don't remove the old index entries so even if you've
locked them you won't prevent people from doing exactly those operations
you're trying to avoid.

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


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: Logging functions executed by queries in 8.2?
Next
From: Rick Gigger
Date:
Subject: Re: 10 weeks to feature freeze (Pending Work)