Getting named fields of NEW - Mailing list pgsql-general

From Erik Ronström
Subject Getting named fields of NEW
Date
Msg-id 20030423021306.35591.qmail@web13804.mail.yahoo.com
Whole thread Raw
Responses Re: Getting named fields of NEW
List 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 by date:

Previous
From: Francisco Reyes
Date:
Subject: Schemas permissions vs \dt
Next
From: Tom Lane
Date:
Subject: Re: Schemas permissions vs \dt