Subject Re: [firebird-support] Unique constraint vs unique index, why do they have to be different?
Author David Garamond
Helen Borrie wrote:
>>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.

Sorry, what I meant was "by using a unique index, don't we effectively
achieve uniqueness of column"? True, FB still requires unique constraint
declaration (not unique index), and that's what I am questioning. If a
column is being uniquely indexed, why doesn't the column automatically
become eligible for being referenced by an FK?

> 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.

Okay, but what is the [effective, visible] difference between a unique
index on a column and a unique key (not PK)?

> -- comply with the standard which allows for people to do dependencies
> that, while contraindicated on the grounds of atomicity, conform with
> relational theory.