Re: plpgsql grief - Mailing list pgsql-sql

From Michael Fork
Subject Re: plpgsql grief
Date
Msg-id Pine.BSI.4.21.0102121124560.21572-100000@glass.toledolink.com
Whole thread Raw
In response to Re: plpgsql grief  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-sql
> Thus your only way to get stuff back from EXECUTE is to save
> the results you want to a temporary table (using CREATE
> TABLE AS ...), and read them back using a query.  Not
> high-performance, but it gets the job done.  
> 

I believe this statement is incorrect, quoting Michael Ansley
<Michael.Ansley@intec-telecom-systems.com> from a previous e-mail:

<QUOTE>
create function testfunc (text) returns int4 as '
declare sql varchar;
begin sql=''SELECT id AS res2 FROM ''||$1 ; execute sql ; return res2;
end;
' language 'plpgsql' ;

Please note the AS syntax rather than INTO.  This was a misconception on
my part, which has obviously lasted longer than I'd hoped ;-)
</QUOTE>

I believe this was the consensus reached on the hacker's list.....

Michael Fork - CCNA - MCP - A+
Network Support - Toledo Internet Access - Toledo Ohio





pgsql-sql by date:

Previous
From: Michael Fork
Date:
Subject: Re: Wierd postgres Problem
Next
From: Tom Lane
Date:
Subject: Re: plpgsql grief