Re: Accessing RECORD variable info - Mailing list pgsql-novice

From Tom Lane
Subject Re: Accessing RECORD variable info
Date
Msg-id 20295.1170611773@sss.pgh.pa.us
Whole thread Raw
In response to Re: Accessing RECORD variable info  (Andreas Kretschmer <akretschmer@spamfence.net>)
Responses If Statement
List pgsql-novice
Andreas Kretschmer <akretschmer@spamfence.net> writes:
> Derrick Betts <list@blueaxis.com> schrieb:
>> How can I determine the actual field name and the field value for the record
>> variable (rec) if I were to look in index 1 or 2 or 3 of the variable?

> Unfortunately you can't access to row-index, you need the name of the
> column.

plpgsql is not designed for that sort of thing; despite the existence of
"record" variables, it's really a strongly typed language and doesn't
cope well with fields of variable data types.  Consider using one of the
other PLs instead (plperl, plpython, etc depending on which language you
like best).  Most of them can handle this easily.

            regards, tom lane

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: connection timeout?
Next
From: "Greg Quinn"
Date:
Subject: If Statement