Subject | Re: [firebird-support] A unique index which is not? |
---|---|
Author | Martijn Tonies |
Post date | 2004-09-20T08:31:44Z |
> Yes. You can't form a FK to a unique INDEX. It has to be a UNIQUEconstraint.
> constraint. A unique index isn't a UNIQUE constraint.
>
> What you really needed here was not this:
>
> CREATE UNIQUE INDEX unique_val ON repl_type (repl_type_code);
>
> but this:
> ALTER TABLE repl_type
> ADD CONSTRAINT uq_repl_type_code
> UNIQUE (repl_type_code);
>
> Make sure you drop the unique index before you create the UNIQUE
>This is why we have GUIs that won't let you create a FK to columns,
> And, yes, the exception message IS misleading.
but only to parent constraints ;-)
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com