Subject RE: [firebird-support] foreign key strangeness
Author Dmitry Yemanov
Martijn,

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


Dmitry