| От | Tom Lane |
|---|---|
| Тема | Re: BUG #13572: Foreign Key Corruption |
| Дата | |
| Msg-id | 13106.1439586462@sss.pgh.pa.us обсуждение |
| Ответ на | BUG #13572: Foreign Key Corruption (herbertsilver@gmail.com) |
| Список | pgsql-bugs |
herbertsilver@gmail.com writes:
> I'm having a bug here. I have a main table and another one referencing to
> its primary key. I'm being able to delete records from the main table at the
> same time postgres keeps the orphaneds rows on the second one.
> I belive it's because of a rule I'm using that is causing the bug, although
> I think it was not supposed to happen anyway.
Yup. Rules act at a level lower than foreign keys, ie a rule can rewrite
the query that is trying to implement ON DELETE CASCADE. And here you
have an ON DELETE DO INSTEAD rule on the target table. This is not a bug,
it's just the way those two features work together.
regards, tom lane
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера