Search Postgresql Archives

Verify a record has a column in a plpgsql trigger

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux