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

From Jeff Davis
Subject Re: WIP: generalized index constraints
Date
Msg-id 1253395251.23353.203.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 Sat, 2009-09-19 at 16:43 -0400, Tom Lane wrote:
> I don't understand why this isn't handled exactly the way unique
> constraints are done now.  Frankly, the amount of added complexity you
> propose below is enough to make me want to reject the patch forthwith;
> given that it's going to be a relatively little-used feature, the bugs
> are never going to be out of it completely if we do it like this.

Unique constraints lock the index page while the insert is happening.
How am I supposed to do that, when the conflicting values might be
anywhere in the index (circles have no total order)?

It may sound complex, but it basically boils down to a two stage
process:1. test for conflicts with concurrently-inserting backends2. test for conflicts that already exist in the index
(dirtyor not)
 

I don't think that it's ridiculously complex. In fact, I think there are
relatively few scenarios that will make any real difference, and those
scenarios can be tested with gdb pretty thoroughly.

Regards,Jeff Davis



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: WIP: generalized index constraints
Next
From: Tom Lane
Date:
Subject: Re: generic copy options