| От | Tom Lane |
|---|---|
| Тема | Re: delete with referential integrity |
| Дата | |
| Msg-id | 19787.1030642651@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | delete with referential integrity (Michael Zouroudis <mzouroudis@idealcorp.com>) |
| Список | pgsql-admin |
Michael Zouroudis <mzouroudis@idealcorp.com> writes:
> because of integrity constraints, i have to
> delete the record from book_asset, then book, and finally assets. all
> inserts, updates, and deletes are done through the assets table, and i
> have a trigger on assets that first deletes book_asset, then books, and
> finally assets. the problem is when it deletes assets on that third
> delete, it sends the db into a recursive loop(the delete on assets
> starts the trigger again).
Why don't you simply let the system carry on with the deletion that the
trigger was called for?
Seems to me the answer to the problem "my trigger is infinitely
recursive" is "make your trigger not recurse".
regards, tom lane
В списке pgsql-admin по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера