Re: Unique Keys

From: Marshall Spight <mspight_at_dnai.com>
Date: Tue, 30 Nov 2004 03:19:51 GMT
Message-ID: <qFRqd.111072$V41.77703_at_attbi_s52>


"Kenneth Downs" <firstinit.lastname_at_lastnameplusfam.net> wrote in message news:kp8n72-hl9.ln1_at_pluto.downsfam.net...
>
> In another subthread of this thread I suggested a datatype interval,
> composed of an ordered pair of any two values of the same base type, (a,b)
> where a<=b. Equality could then be defined as:
>
> where x = (a,b)
> and y = (c,d)
>
> x = y iff (a <= c <= b) OR (a <= d <= b)
>
> This allows the declarative Unique and RI constraints.

I think what's happened here is that you've tricked yourself.

If we allow that a new datatype can define equality any way it wants, and we want to express exactly one specific constraint, we can code up an equals function that expresses this constraint, and use a uniqueness specification to enforce that the constraint always holds for any two elements.

But that's not really right. It's not equality, and it's not uniqueness.

What you've really done is say you want no two periods to overlap, and then defined overlap as equals.

Marshall Received on Tue Nov 30 2004 - 04:19:51 CET

Original text of this message