Subject Re: [firebird-support] foreign key strangeness
Author Martijn Tonies
Hi Dmitry,

> > > Both ;-) And I tend to fix this in the next FB release.
> >
> > Out of curiosity: exactly what part is the issue? And what part
> > is by design? :)
>
> By design, no checks are made to validate the datatype compatibility for
the
> both parther indices. And exactly this fact is the issue too ;-)
> > Meaning: can't I create an FK from an Integer to a VARCHAR
> > containing integers?
>
> The standard says that both datatypes should be comparable. Since VARCHAR
is
> comparable with [almost[ everything, it seems you should be able to do
that.
> But I don't see much value in such FKs. And it definitely leads to some
> types of weird errors or even data corruptions. Hence I tend to disable
this
> possibilty.

So Firebird will not follow the standard here?

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL & MS SQL
Server.
Upscene Productions
http://www.upscene.com