Reference to NEW, OLD values in TRIGGER

Поиск
Список
Период
Сортировка
От Andrey Mosienko
Тема Reference to NEW, OLD values in TRIGGER
Дата
Msg-id 3CD81B04.2020308@ttn.ru
обсуждение исходный текст
Список pgsql-general
Hello All!

How can I access NEW or OLD fields in trigger with variable?
I need it to create more universal function to work with tables
when I don't know the table structure.

Example:

Now:
IF NEW.empname ISNULL THEN
             RAISE EXCEPTION ''empname cannot be NULL value'';
END IF;


As I wish. or something like that:
DECLARE
    str text;
BEGIN
    str := 'empname';
IF NEW.''str'' ISNULL THEN
    ^^^^^^
             RAISE EXCEPTION ''empname cannot be NULL value'';
END IF;
END;




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

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: Index usage vs large repetitions of key
Следующее
От: Jason Earl
Дата:
Сообщение: Re: Contrib reindex script: