| От | Thomas Kellerer |
|---|---|
| Тема | Why does Postgres allow duplicate (FK) constraints |
| Дата | |
| Msg-id | kisgbp$f45$1@ger.gmane.org обсуждение исходный текст |
| Ответы |
Re: Why does Postgres allow duplicate (FK) constraints
|
| Список | pgsql-general |
Hi,
I was a bit surprised that the following DDL will work:
create table parent (id integer not null primary key);
create table child (id integer not null primary key, pid integer not null);
alter table child
add constraint fk_child_parent
foreign key (pid) references parent(id);
alter table child
add foreign key (pid) references parent(id);
It essentially creates the same foreign key constraint twice.
While I agree that this SQL should not have been written like this in the first place, I wonder why Postgres doesn't
activelyprevent this (like e.g. Oracle).
Is there a technical reason, or is it simply a matter of "no one cared enough to change this"?
Regards
Thomas
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера