Re: WIP: generalized index constraints

Jeff Davis <pgsql@j-davis.com>

From: Jeff Davis <pgsql@j-davis.com>
To: tomas@tuxteam.de
Cc: Robert Haas <robertmhaas@gmail.com>, Brendan Jurd <direvus@gmail.com>, Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>, pgsql-hackers@postgresql.org
Date: 2009-09-16T16:45:52Z
Lists: pgsql-hackers
On Wed, 2009-09-16 at 15:11 +0200, tomas@tuxteam.de wrote:
> One question: does the operator have to be reflexive? I.e. "A op A holds
> for all A"?

I don't think that reflexivity is a strict requirement. You could make
this a constraint over a boolean attribute such that false conflicts
with true and true conflicts with false. That would mean that your table
would have to consist of either all false or all true.

> I am thinking "proximity" or as you state above "similarity". May be
> this is a good metaphor, leading to a good name.

That's an interesting idea: "proximity constraint". I like it because
(a) "proximity" might reasonably be considered a more general form of
the word "unique", which might satisfy Peter's argument; (b) it conveys
the use case; and (c) it sounds good.

There are a couple bizarre cases where "proximity" doesn't quite fit,
like my boolean example above, but I'm OK with that.

Regards,
	Jeff Davis