Re: Why does Postgres allow duplicate (FK) constraints

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Kellerer <spam_eater(at)gmx(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Why does Postgres allow duplicate (FK) constraints
Date: 2013-03-26 16:03:36
Message-ID: 13271.1364313816@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thomas Kellerer <spam_eater(at)gmx(dot)net> writes:
> While I agree that this SQL should not have been written like this in the first place, I wonder why Postgres doesn't actively prevent this (like e.g. Oracle).

If Oracle does that, they're violating the SQL standard --- there is
nothing in the standard that supports rejecting an ALTER TABLE ADD
CONSTRAINT on the grounds that it's redundant. The spec only says
you can't give two constraints the same name.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Kellerer 2013-03-26 16:07:48 Re: Why does Postgres allow duplicate (FK) constraints
Previous Message Thomas Kellerer 2013-03-26 15:55:40 Why does Postgres allow duplicate (FK) constraints