Re: Why does Postgres allow duplicate (FK) constraints
От
Tom Lane
Тема
Re: Why does Postgres allow duplicate (FK) constraints
Дата
Msg-id
13611.1364314568@sss.pgh.pa.us
Ответ на
Re: Why does Postgres allow duplicate (FK) constraints (Thomas Kellerer)
Список
Дерево обсуждения
Why does Postgres allow duplicate (FK) constraints Thomas Kellerer <spam_eater@gmx.net>
Re: Why does Postgres allow duplicate (FK) constraints Tom Lane <tgl@sss.pgh.pa.us>
Re: Why does Postgres allow duplicate (FK) constraints Thomas Kellerer <spam_eater@gmx.net>
Re: Why does Postgres allow duplicate (FK) constraints Tom Lane <tgl@sss.pgh.pa.us>
Re: Why does Postgres allow duplicate (FK) constraints Thomas Kellerer <spam_eater@gmx.net>
Re: Why does Postgres allow duplicate (FK) constraints Alban Hertroys <haramrae@gmail.com>
Re: Why does Postgres allow duplicate (FK) constraints Thomas Kellerer <spam_eater@gmx.net>
Re: Why does Postgres allow duplicate (FK) constraints Kevin Grittner <kgrittn@ymail.com>
Thomas Kellerer writes: > Tom Lane, 26.03.2013 17:03: >> 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. > Is there anything in the standard that actively requires that you can create two "identical" constraints? The lack of any prohibition to the contrary means there is no way to argue that the code you showed previously violates the spec; thus, a database that fails to accept it is rejecting spec-compliant DDL. > Because technically it simply doesn't make sense, does it? Well, it's redundant, but that doesn't make it wrong. In any case, there are lots of ways that things might be redundant. Should we reject a unique constraint on (a,b) if there's already one on (b,a)? Or if there are separate unique constraints on each of a and b? regards, tom lane
В списке pgsql-general по дате отправления
От: Thomas Kellerer
Дата: