Subject RE: [firebird-support] FK confusion
-----Original Message-----
[] On Behalf Of Ann W. Harrison
Sent: Monday, July 10, 2006 3:08 PM
> To:
> Subject: Re: [firebird-support] FK confusion
> firebird@... wrote:
> > I get this error message:
> >
> > This operation is not defined for system tables.Unsuccessful metadata
> > update.
> > Could not find UNIQUE INDEX with specified columns.
> >
> It's a lousy error message. What it should say is that it couldn't
> find a unique constraint. There are three ways of declaring that a
> field or set of fields should be unique: 1) declare them to be a
> primary key, 2) declare them to be subject to a unique constraint,
> 3) declare a unique index on them. The third exists for historical
> reasons and predates SQL as InterBase's primary language. The SQL
> standard requires that the referenced fields in a foreign key
> constraint be subject to one of the first two. So drop the unique
> index, replace it with a unique constraint, and all will be well...

I googled it to death a little later in the day. But it's good to
know *WHY* this was the case.

> Except for the odd primary key, I guess...

History is the millstone around my neck too. The design was originally for
Paradox for DOS. That primary key is not the only thing on the list
of changes, but I have to get it converted as-is first. The only
thing that's saving me is that this is a relatively tiny database,
so even TTable analogs will probably work well enough to get by.