| От | Tom Lane |
|---|---|
| Тема | Re: FW: BUG in trigger and foreign keys |
| Дата | |
| Msg-id | 23364.1040789278@sss.pgh.pa.us обсуждение |
| Ответ на | Re: FW: BUG in trigger and foreign keys ("Jefim Matskin" <JefimM@sphera.com>) |
| Список | pgsql-general |
"Jefim Matskin" <JefimM@sphera.com> writes:
> If try it with the same script - but without the constraints - you will see the difference.
> And there should not be any since the data is the same in the tables.
No, it's not the same. Consider the implications of the constraint
you added:
ALTER TABLE reseller ADD CONSTRAINT FK_reseller_parent
FOREIGN KEY (parent_id) REFERENCES reseller(reseller_id)
ON DELETE CASCADE ON UPDATE CASCADE;
^^^^^^^^^^^^^^^^^
This will cause the delete of reseller_id 1338 to propagate to the rows
in which 1338 appears as parent_id. Which sure looks to me like it's
the behavior you're complaining of.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера