Re: FK type mismatches? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: FK type mismatches?
Date
Msg-id 7346.1062742480@sss.pgh.pa.us
Whole thread Raw
In response to FK type mismatches?  (Neil Conway <neilc@samurai.com>)
Responses Re: FK type mismatches?  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: "Christopher Kings-Lynne"
Date:
Subject: Re: Seqscan in MAX(index_column)
Next
From: "Shridhar Daithankar"
Date:
Subject: Re: Prelimiary DBT-2 Test results