| От | Tom Lane |
|---|---|
| Тема | Re: Delete Trigger |
| Дата | |
| Msg-id | 29324.1281801215@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Delete Trigger (Chris Berry <chrisdberry82@googlemail.com>) |
| Список | pgsql-general |
Chris Berry <chrisdberry82@googlemail.com> writes:
> When I update, insert or delete to one table, I need a trigger to delete and
> possibly insert into another table. The trigger I have works for insert and
> update, but returns an error when I do a delete.
There's no "NEW" row in a delete trigger (... and the error message
should have told you that pretty explicitly ...). You can look at the
OLD row instead.
BTW, you should probably think carefully about what the UPDATE case
is doing and whether it needs to look at NEW or OLD or a combination.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера