BUG #11554: Enforce that number and type of both columns involved in fkey are same type

From: gary(dot)weaver(at)protolabs(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #11554: Enforce that number and type of both columns involved in fkey are same type
Date: 2014-10-02 15:55:21
Message-ID: 20141002155521.2543.72522@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 11554
Logged by: Gary Weaver
Email address: gary(dot)weaver(at)protolabs(dot)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!

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2014-10-02 22:03:15 Re: BUG #11477: psql -L no stderr
Previous Message Harry 2014-10-02 15:11:40 BUG #11553: Sum function does not exist in Create View