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

From Bruce Momjian
Subject Re: FK type mismatches?
Date
Msg-id 200309052109.h85L9K419187@candle.pha.pa.us
Whole thread Raw
In response to Re: FK type mismatches?  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-hackers
Peter Eisentraut wrote:
> Neil Conway writes:
> 
> > Should this produce a warning?
> >
> > nconway=# create table a (b int4 unique);
> > NOTICE:  CREATE TABLE / UNIQUE will create implicit index "a_b_key" for
> > table "a"
> > CREATE TABLE
> > nconway=# create table c (d int8 references a (b));
> > NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY
> > check(s)
> > CREATE TABLE
> 
> I don't think so.  We don't produce warnings in other cases of potential
> index mismatches either.

The issue is that it isn't likely someone would be doing a foreign key
mismatch, while a mismatch in a query would be more likely.  We could
make it a HINT and then people could configure their servers to suppress
the hint if they wish.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
359-1001+  If your life is a hard drive,     |  13 Roberts Road +  Christ can be your backup.        |  Newtown Square,
Pennsylvania19073
 


pgsql-hackers by date:

Previous
From: Robert Treat
Date:
Subject: Re: Logging improvements and rehashing
Next
From: Robert Treat
Date:
Subject: Re: FK type mismatches?