Re: access computed field of RECORD variable - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: access computed field of RECORD variable
Date
Msg-id 20100105141349.GD3660@alvh.no-ip.org
Whole thread Raw
In response to access computed field of RECORD variable  (Steve White <swhite@aip.de>)
List pgsql-general
Steve White wrote:

> The roadblock is:
>
> There is a record, which may be from any of a set of similar databases.
> Field names for this record are computed as strings.  Using these strings,
> I need to access fields of the record.
>
> But I can't find the syntax for it.

You can't do this with plpgsql.  There are some limited possibilities
with "EXECUTE 'foo bar $1 baz' USING rec" where the $1 is expanded with
the record.  However the best thing you can do is use a different PL,
probably PL/Perl.



--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-general by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Looking for advice on working with revisions
Next
From: Sam Mason
Date:
Subject: Re: Shall I use PostgreSQL Array Type in The Following Case