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

From Merlin Moncure
Subject Re: access computed field of RECORD variable
Date
Msg-id b42b73151001050653i2c523c49v5a763679e3d8331a@mail.gmail.com
Whole thread Raw
In response to access computed field of RECORD variable  (Steve White <swhite@aip.de>)
Responses Re: access computed field of RECORD variable  (Steve White <swhite@aip.de>)
List pgsql-general
On Tue, Jan 5, 2010 at 8:53 AM, Steve White <swhite@aip.de> wrote:
> Hi,
>
> I ran into a roadblock at the very bottom of a fairly large database
> design implementation.  It will be at least messy to fix, unless there is
> a neat solution.
>
> 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.
>
> Now, if a record variable is a known row type, I can get a field of a
> computed name.
> For a generic RECORD I can get a field by putting an explicit name the code,
>        (rec).FieldName1
> But can one get the value of a computed field from a generic RECORD?
>

why are you using generic records then? :-)  Maybe there is an elegant
solution to your issue with a bit more context.

merlin

pgsql-general by date:

Previous
From: Sam Mason
Date:
Subject: Re: Some issues about data type convert
Next
From: "Gauthier, Dave"
Date:
Subject: Re: Shall I use PostgreSQL Array Type in The Following Case