Re: bug in 8.3? foreign key refers to different type - Mailing list pgsql-general

From Stephan Szabo
Subject Re: bug in 8.3? foreign key refers to different type
Date
Msg-id 20080226171221.T54269@megazone.bigpanda.com
Whole thread Raw
In response to bug in 8.3? foreign key refers to different type  (craigp <craigp98072@yahoo.com>)
Responses Re: bug in 8.3? foreign key refers to different type
List 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.

pgsql-general by date:

Previous
From: craigp
Date:
Subject: bug in 8.3? foreign key refers to different type
Next
From: Bruno Baguette
Date:
Subject: How can I get the first and last date of a week, based on the week number and the year