Re: referential Integrity and SHARE locks

From: Gregory Stark <stark(at)enterprisedb(dot)com>
To: "Marc Munro" <marc(at)bloodnok(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>, <simon(at)2ndquadrant(dot)com>
Subject: Re: referential Integrity and SHARE locks
Date: 2007-02-06 23:47:08
Message-ID: 873b5ivog3.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Marc Munro" <marc(at)bloodnok(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rick Gigger 2007-02-06 23:59:04 Re: 10 weeks to feature freeze (Pending Work)
Previous Message Josh Berkus 2007-02-06 23:12:58 Re: Logging functions executed by queries in 8.2?