Re: Foreign key constraint accepted even when not same

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Dennis Bjorklund <db(at)zigo(dot)dhs(dot)org>
Cc: 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-23 15:03:53
Message-ID: 20030923073015.L28541@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 23 Sep 2003, Dennis Bjorklund wrote:

> On Mon, 22 Sep 2003, Stephan Szabo wrote:
>
> > 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.
>
> Is it possible to drop the equality operator when one have FK that needs
> it?

Actually, right now, I think it is (as are necessary casts). That's
probably not good, but since the actual constraint isn't that you can't
drop the equality operator, but that the types must still be comparable
after doing so, I'm not sure how one would represent that right now (for
example, given an int->foo equality operator and foreign key, if there was
say a numeric->foo equality operator, dropping the int one is probably
okay assuming an implicit int->numeric cast).

In response to

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2003-09-23 15:10:34 Re: Scalability (both vertical and horizontal)?
Previous Message Shridhar Daithankar 2003-09-23 14:58:57 Re: How to get the total number of rows returned by query