Re: Referencing Cursor/Row/Record Fields in PL/PgSQL

From: Lee Hughes <lee(at)hughesys(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Referencing Cursor/Row/Record Fields in PL/PgSQL
Date: 2009-02-11 00:16:47
Message-ID: 2d739b560902101616h25793ac7gc1fdf7390acb3128@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I thought that's what EXECUTE was for in plpgsql -- isn't there a way to
extract the value of a field in a row/record variable by building a SELECT
string and passing it to EXECUTE?

On Tue, Feb 10, 2009 at 1:22 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Lee Hughes <lee(at)hughesys(dot)com> writes:
> > Trying to figure out how to reference a field in a cursor result, or in a
> > row/record variable that I've FETCHed the cursor into, where the target
> > field name is in a variable or parameter. I think I'm just missing the
> > dereferencing syntax.
>
> There isn't any --- plpgsql doesn't deal in accesses to unknown fields
> (mainly because it can't know their type, and it's a strongly typed
> language). Consider plperl or plpython or pl-anything-but-pgsql.
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-02-11 00:46:46 Re: Continual increase of age(datfrozenxid) for template0
Previous Message Hiroshi Inoue 2009-02-11 00:15:44 Re: encoding of PostgreSQL messages