Neil Conway <neilc@samurai.com> writes:
> Should this produce a warning?
> [ foreign-key reference to column of a different datatype ]
> Aside from the logical inconsistency, it will also lead to poor
> performance since the type mismatch will prevent index scans. I've
> noticed a couple people have reported performance issues due to making
> this kind of mistake.
There was some discussion of this a couple weeks back, but I don't recall
any clear consensus emerging. I'm for it myself though.
If we follow Peter's recently proposed guideline, this would have to be
a NOTICE not a WARNING, because the command absolutely is doing what you
told it to do. Peter, does that make you uncomfortable? It's not
exactly the answer I would've wanted. In this context it seems like we
want WARNING to mean "we'll do what you told us to do, but are you really
*sure* it is what you want?"
regards, tom lane