Getting named fields of NEW

From: Erik Ronström <kvarken(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Getting named fields of NEW
Date: 2003-04-23 02:13:06
Message-ID: 20030423021306.35591.qmail@web13804.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-04-23 04:07:30 Re: Schemas permissions vs \dt
Previous Message Francisco Reyes 2003-04-23 01:50:47 Schemas permissions vs \dt