Re: Foreign key data type mismatches

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Foreign key data type mismatches
Date: 2003-12-01 15:33:24
Message-ID: 20031201073028.I44545@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 1 Dec 2003, Peter Eisentraut wrote:

> I was just annoyed to find out that a foreign key doesn't check whether
> the referenced column has a sufficiently similar data type, it only checks
> whether an = operator exists. This masks schema design errors and typos.
> Should this be tightened up, for example using the castability
> characteristics between the two data types?

Maybe, but IIRC the spec only requires comparability between the types
involved. Since we don't use the same rules as the spec for that,
existance of equality comparison was treated as the closest match to the
requirement at the time.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message ow 2003-12-01 15:33:26 Max number of rows in a table
Previous Message Tom Lane 2003-12-01 15:13:11 Re: [HACKERS] initdb should create a warning message [was Re: [ADMIN] Size on Disk]