Обсуждение: RECORD fields by name

Поиск
Список
Период
Сортировка

RECORD fields by name

От
Erik Ronström
Дата:
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


Re: RECORD fields by name

От
Tom Lane
Дата:
=?iso-8859-1?q?Erik=20Ronstr=F6m?= <kvarken@yahoo.com> writes:
> In a plpgsql function, is it possible to retrieve values from a RECORD
> if the fieldname is not known when writing the function?

No.  Try pltcl instead ...

            regards, tom lane