pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: gary.weaver@protolabs.com
To: pgsql-bugs@postgresql.org
Subject: BUG #11554: Enforce that number and type of both columns involved in fkey are same type
Date: Thu, 02 Oct 2014 15:55:21 +0000
Message-ID: <20141002155521.2543.72522@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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!


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (3+ messages)  latest in thread

Message-ID: <20141002155521.2543.72522@wrigleys.postgresql.org>
Permalink:  ../20141002155521.2543.72522@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20141002155521.2543.72522@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: gary.weaver@protolabs.com
  Subject: Re: BUG #11554: Enforce that number and type of both columns involved in fkey are same type
  In-Reply-To: <20141002155521.2543.72522@wrigleys.postgresql.org>
  References: <20141002155521.2543.72522@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox