Subject Re: [firebird-support] Unique constraint vs unique index, why do they have to be different?
Author Helen Borrie
At 11:52 PM 13/12/2003 +0700, you wrote:
>I know they are "conceptually" different, but apart from the first one
>being able to be used in FK relation and the other cannot, what are the
>other practical differences between the two?

>Aren't UC always
>"implemented" using UI?

Yes.

>(And by using UI, don't we effectively achieve UC?)

No. A unique index isn't a unique constraint - it can't be referenced by a
foreign key.


>Why can't/won't the Firebird engine behave like this: if a UI is added,
>UC is also automatically be declared, and vice versa. Why do we still
>need to separate both? Historical reason?

It's there to
-- cater for people like yourself who want to reference columns other than
the PK in FK relationships. Dependencies are created on keys, not indexes.
-- comply with the standard which allows for people to do dependencies
that, while contraindicated on the grounds of atomicity, conform with
relational theory.

/heLen