Re: WIP: generalized index constraints - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: WIP: generalized index constraints
Date
Msg-id 1253465040.6983.6.camel@jdavis
Whole thread Raw
In response to Re: WIP: generalized index constraints  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: WIP: generalized index constraints
List pgsql-hackers
On Sun, 2009-09-20 at 12:31 -0400, Tom Lane wrote:
> > T1: inserts into index
> > T2: inserts into index
> > T1: checks index for conflicts, finds T2
> > T2: checks index for conflicts, finds T1
> 
> You get a deadlock failure, because both transactions will wait for each
> other.  So what?  It's an error in any case, and you can get a reported
> deadlock in constraint-enforcement scenarios today (conflicting FK
> changes, for instance).

Well, in theory, one of the transactions may have been destined to be
aborted later anyway, and the deadlock detector might kill the wrong
one. But I agree, perhaps I'm over-thinking this one.

Aside: I just realized that my solution to the deadlock problem won't
work with your simpler idea anyway. When reading the index we've long
since lost the information about the specific insert of the specific
command of the other transaction.

I'll make the change.

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: operator exclusion constraints [was: generalized index constraints]
Next
From: Peter Eisentraut
Date:
Subject: Re: FDW-based dblink (WIP)