Re: Delete trigger and data integrity

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: Delete trigger and data integrity
Дата
Msg-id CAF-3MvPqy1HsfPehvTxVr8fZRe8m7ywoN+63sVGJKa=pfhMmUQ@mail.gmail.com
обсуждение исходный текст
Ответ на Delete trigger and data integrity  (Yvonne Zannoun <yvonne.zannoun@snowflakesoftware.com>)
Список pgsql-general
On 27 May 2014 12:25, Yvonne Zannoun
<yvonne.zannoun@snowflakesoftware.com> wrote:
> CREATE OR REPLACE FUNCTION delete_records()
> RETURNS TRIGGER AS $$
> BEGIN
> delete from "TABLE";
>     RETURN NEW;
> END;
> $$
> LANGUAGE plpgsql;

You can't return NEW in an ON DELETE trigger - there is no NEW record.
Since you're going with a STATEMENT trigger instead, that's not really
relevant anymore (no NEW _or_ OLD record, since statements aren't
necessarily involved with single records), but I thought I'd mention
that slight oversight ;)

--
If you can't see the forest for the trees,
Cut the trees and you'll see there is no forest.


В списке pgsql-general по дате отправления: