Re: BUG #13572: Foreign Key Corruption

Поиск
Список
Период
Сортировка
От 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 по дате отправления:

Предыдущее
От: herbertsilver@gmail.com
Дата:
Сообщение: BUG #13572: Foreign Key Corruption
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #13571: sql-only extension segfaults backend during creation