Wrong note in the information schema section?

Поиск
Список
Период
Сортировка
От Daniel Westermann (DWE)
Тема Wrong note in the information schema section?
Дата
Msg-id GVAP278MB0931DCD66FD3EE21972D0695D2CB9@GVAP278MB0931.CHEP278.PROD.OUTLOOK.COM
обсуждение исходный текст
Ответы Re: Wrong note in the information schema section?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-docs
Hi %.

we have this note in the information schema section, e.g. in
https://www.postgresql.org/docs/current/information-schema.html

..."This is because the SQL standard requires constraint names to be unique within a schema, but PostgreSQL does not
enforcethis restriction."  
...
PostgreSQL does enforce unique constraint names in a schema:

postgres=# create table t1 ( a int );
CREATE TABLE
postgres=# alter table t1 add constraint c1 unique (a);
ALTER TABLE
postgres=# alter table t1 add constraint c1 unique (a);
ERROR:  relation "c1" already exists

Am I reading this wrong? I know you can have the same constraint with different names:

postgres=# create table t1 ( a int );
CREATE TABLE
postgres=# alter table t1 add constraint c2 unique (a);
ALTER TABLE
postgres=# alter table t1 add constraint c3 unique (a);
ALTER TABLE

... but I guess this is not what the notes is supposed to tell me, correct?

Regards
Daniel


В списке pgsql-docs по дате отправления:

Предыдущее
От: PG Doc comments form
Дата:
Сообщение: I came here to determine how much storage a boolean variable uses
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Wrong note in the information schema section?