Re: bug in 8.3? foreign key refers to different type

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: craigp <craigp98072(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: bug in 8.3? foreign key refers to different type
Date: 2008-02-27 01:18:04
Message-ID: 20080226171221.T54269@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 26 Feb 2008, craigp wrote:

> These create table commands succeed, even tho the foreign key refers to
> a 'different' type (int2 product_id column refers to an int8 column):

The requirements in recent SQL specs appears to be that the column types
are comparable, not the same.

SQL2003 11.8 <referential constraint definition>
"The declared type of each referencing column shall be comparable to the
declared type of the corresponding referenced column."

As far as I can tell the spec requires two numbers to be comparable, which
would make a failure for numeric or real an actual bug, but I don't have
an 8.3 system available at the moment to confirm against.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Baguette 2008-02-27 01:32:49 How can I get the first and last date of a week, based on the week number and the year
Previous Message craigp 2008-02-27 00:27:26 bug in 8.3? foreign key refers to different type