PLpgSQL FOR IN EXECUTE question - Mailing list pgsql-sql

From Christoph Haller
Subject PLpgSQL FOR IN EXECUTE question
Date
Msg-id 3DCA7A2E.6DD4CABE@rodos.fzk.de
Whole thread Raw
Responses Re: PLpgSQL FOR IN EXECUTE question  (Richard Huxton <dev@archonet.com>)
Re: PLpgSQL FOR IN EXECUTE question  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: PLpgSQL FOR IN EXECUTE question  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-sql
Consider the following PLpgSQL code fragment

FOR this_record IN
EXECUTE ''SELECT ''       || quote_ident($1)       || ''FROM ''       || quote_ident($2)
LOOP   list := list || '', '' || this_record.$1 ;
END LOOP;

As expected, accessing a field via this_record.$1
does not work.
Can it be done otherwise?

Regards, Christoph



pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: cast lo to oid
Next
From: Tomasz Myrta
Date:
Subject: Re: primary keys