Re: Primary key error in INFORMATION_SCHEMA views
От | Tom Lane |
---|---|
Тема | Re: Primary key error in INFORMATION_SCHEMA views |
Дата | |
Msg-id | 8886.1527107987@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Primary key error in INFORMATION_SCHEMA views (SQLpro <sqlpro@sqlspot.com>) |
Ответы |
Re: Primary key error in INFORMATION_SCHEMA views
|
Список | pgsql-bugs |
SQLpro <sqlpro@sqlspot.com> writes: > The Following script demonstrate the bug: > CREATE SCHEMA s; > CREATE TABLE s.foo (C INT); > ALTER TABLE s.foo ADD CONSTRAINT k CHECK(C>0); > CREATE TABLE s.foo2 (C INT); > ALTER TABLE s.foo2 ADD CONSTRAINT k CHECK(C>=1); > This last SQL command should fail because the database name, the schema name > and the constraint name is the same for those two constraints, but did'nt ! Indeed, but Postgres does not require check constraints to be named uniquely across the whole schema, only per-table. Tightening that would be a cure worse than the disease, because it would break applications that work today. So, sorry, we do not consider this a bug, and it's highly unlikely that we'd ever "fix" it. You're surely free to use only spec-compliant choices of constraint names in your own databases if you wish, but PG won't enforce that. regards, tom lane
В списке pgsql-bugs по дате отправления: