BUG #11554: Enforce that number and type of both columns involved in fkey are same type - Mailing list pgsql-bugs

From gary.weaver@protolabs.com
Subject BUG #11554: Enforce that number and type of both columns involved in fkey are same type
Date
Msg-id 20141002155521.2543.72522@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #11554: Enforce that number and type of both columns involved in fkey are same type  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      11554
Logged by:          Gary Weaver
Email address:      gary.weaver@protolabs.com
PostgreSQL version: 9.3.2
Operating system:   Linux
Description:

To help adhere to the statement, "Of course, the number and type of the
constrained columns need to match the number and type of the referenced
columns." as noted in
http://www.postgresql.org/docs/9.3/static/ddl-constraints.html shouldn't PG
enforce that both columns involved in a foreign key constraint are of the
same number and type (e.g. int != bigint) at time of constraint creation?

And possibly the default for enforcement could be configured to be off, if
this were released in a 9.x release and then defaulted to on for 10.x+
releases of PG, if this is considered desirable.

The problem is that if you are forced to use a tool that syncs data between
databases of different types, other databases sometimes enforce that the
types cannot be different. While this is not a frequent use case, it just
makes sense in most cases that you'd want the two column types/sizes to be
the same.

Thanks for your help!

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #11477: psql -L no stderr
Next
From: John R Pierce
Date:
Subject: Re: BUG #11553: Sum function does not exist in Create View