Re: Delete Trigger

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

Предыдущее
От: "maxxedit@gmail.com"
Дата:
Сообщение: heap-only tuples, and constraints
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Windows 2003 server installation issue