RECORD fields by name

From: Erik Ronström <kvarken(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: RECORD fields by name
Date: 2003-05-01 13:09:33
Message-ID: 20030501130933.29765.qmail@web13804.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

In a plpgsql function, is it possible to retrieve values from a RECORD
if the fieldname is not known when writing the function?

I'm writing a trigger function which takes a table name and a field
name as arguments and modifies NEW. The problem is that I can't figure
out how to access NEW.[fieldname], since [fieldname] cannot be a
variable.

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-05-01 14:15:29 Re: RECORD fields by name
Previous Message Søren Neigaard 2003-05-01 13:03:42 PostgreSQL backup script