Re: Foreign key constraint accepted even when not same

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>, postgresql <pgsql-general(at)postgresql(dot)org>
Subject: Re: Foreign key constraint accepted even when not same
Date: 2003-09-25 02:42:45
Message-ID: 20030924193348.Y67854@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 24 Sep 2003, Bruce Momjian wrote:

> Tom Lane wrote:
> > Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> writes:
> > > On Mon, 22 Sep 2003, Jean-Christian Imbeault wrote:
> > >> Is it right for postgres to accept a foreign key constraint when the
> > >> type of the field is not the same as that of the foreign key?
> >
> > > IIRC in SQL92 it's said that they need to be the same type, but in SQL99
> > > it says that the two types must be comparable. We basically implement the
> > > latter, basically using the existance of a usable equality operator as the
> > > determination of comparable.
> >
> > Note however that performance may be poor with a cross-type foreign key
> > reference, if the planner is unable to figure out how to use an index
> > for the check queries.
>
> Didn't we agree to throw a NOTICE in cases of a mismatch? (I think
> Peter agreed to a NOTICE but not a WARNING) Is that completed?

Did that get decided upon? In any case, I don't think domains were talked
about. Should it be decided upon the base type of the domain(s) involved
or just that the final types are different?

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2003-09-25 02:58:48 Re: About GPL and proprietary software
Previous Message Bruce Momjian 2003-09-25 02:28:52 Re: "Expiring" transactions?