Verify a record has a column in a plpgsql trigger

Поиск
Список
Период
Сортировка
От Mike Ginsburg
Тема Verify a record has a column in a plpgsql trigger
Дата
Msg-id 4B6AF8B6.3050802@collaborativefusion.com
обсуждение исходный текст
Ответы Re: Verify a record has a column in a plpgsql trigger  (Merlin Moncure <mmoncure@gmail.com>)
Список pgsql-general
I have a plpgsql function that serves as a change log for a few tables
in my db (8.4.2).  In most of the tables that I am logging, there is an
"editor" column that stores the ID of the user who made the change, so
as part of the function I set

editor := NEW.editor;

There are a few of the tables that don't store editor, in which case I
am ok with inserting it into the log as NULL.  The problem is I can't
seem to come up with a conditional to see if NEW has a column named
"editor".

Any help is greatly appreciated.
Thanks.

Mike Ginsburg



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

Предыдущее
От: "Wang, Mary Y"
Дата:
Сообщение: Any Good Postgresql Courses Offered in the US Area?
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: Any Good Postgresql Courses Offered in the US Area?