Re: access computed field of RECORD variable

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: access computed field of RECORD variable
Дата
Msg-id 20100105141349.GD3660@alvh.no-ip.org
обсуждение исходный текст
Ответ на access computed field of RECORD variable  (Steve White <swhite@aip.de>)
Список 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 по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Looking for advice on working with revisions
Следующее
От: Sam Mason
Дата:
Сообщение: Re: Shall I use PostgreSQL Array Type in The Following Case