Thursday, September 25, 2008

[GENERAL] Indirect access to NEW or OLD records


I have a variable with a field name and want to extract this field
value from NEW record:

field VARCHAR = 'some_field';
value := NEW.{field}; -- ???

Is it possible in pl/pgsql?

I have found one speed-inefficient solution: convert NEW to string and
then - use EXECURE with customly-build query to extract a value from
that constant string. But it is too slow. Is there better solution?

Sent via pgsql-general mailing list (
To make changes to your subscription:

No comments: