Re: Foreign keys for non-default datatypes

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, CG <cgg007(at)yahoo(dot)com>
Subject: Re: Foreign keys for non-default datatypes
Date: 2006-03-03 05:54:19
Message-ID: 26721.1141365259@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com> writes:
> On Thu, 2 Mar 2006, Tom Lane wrote:
>> 1. If the index opclass contains an exact operator for the case
>> "PKtype = FKtype", use that operator.

> Is this rule to read explicitly naming '=' or just the item in that
> position in the opclass?

The operator occupying the equality position in the opclass.

> I think it's an acceptable idea to fail if we're going to extend the
> cross-type indexing support, but AFAICS we have to at the very least allow
> all of the "standard" numeric types in all combinations to work to meet
> the spec, and I don't think the above rules and current opclasses will
> give that to us (and I don't honestly understand some of the bits of this
> to know if there's a problem with extending the opclasses to allow that).

The cases that are likely to be problematic are things like a FLOAT8
column referencing a NUMERIC primary key. However, that sort of
mishmash is fraught with all kinds of risks anyway (think roundoff
error) so the fact that the spec nominally allows it doesn't tell me
that we ought to encourage it.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2006-03-03 06:07:06 Re: PostgreSQL Anniversary Summit, Call for Contributions
Previous Message Chris Browne 2006-03-03 05:27:31 Re: PostgreSQL Anniversary Summit, Call for Contributions