| От | Michaël Lemaire |
|---|---|
| Тема | Delete triggers order in delete cascade (pg 8.3.7). |
| Дата | |
| Msg-id | 20090702115650.5a93fcb8@altair обсуждение исходный текст |
| Ответы |
Re: Delete triggers order in delete cascade (pg 8.3.7).
|
| Список | pgsql-general |
Hi all. I've come across a problem with delete cascade. I have three tables A, B and C. Table B has a foreign key on A with delete cascade. Table C has a foreign key on B with delete cascade. So, we have this reference chain: C->B->A All three tables have an 'on delete' trigger. My problem is, when I delete a row from A, the delete triggers are fired in the order A then B then C, which is the opposite of what I expected (the row from B should be deleted before the A one, or the reference constraint would break). This happens with 'after' and 'before' triggers. I really need the order to be C then B then A. Is there a reason for the triggers to fire in this order ? Has anyone an idea to reverse it ? Thanks in advance. Michaël Lemaire
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера