Getting named fields of NEW

Поиск
Список
Период
Сортировка
От Erik Ronström
Тема Getting named fields of NEW
Дата
Msg-id 20030423021306.35591.qmail@web13804.mail.yahoo.com
обсуждение исходный текст
Ответы Re: Getting named fields of NEW  (Darko Prenosil <darko.prenosil@finteh.hr>)
Список pgsql-general
Hello,

I am writing a trigger function, which is supposed to take a field name
as a parameter (this is because I want to use the same function for
many tables).

When in an INSERT trigger (firing *before* the insert), you can use the
NEW parameter to access the row to be inserted. The problem is that I
don't know the names of the fields. I can't figure out how to use a
variable (or input parameter in this case) as a field marker, as in

NEW.VarName

The documentation on FOR-IN-EXECUTE doesn't seem to help in this case
:(

Erik

__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer


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

Предыдущее
От: Francisco Reyes
Дата:
Сообщение: Schemas permissions vs \dt
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Schemas permissions vs \dt