Re: plpgsql grief

Поиск
Список
Период
Сортировка
От Michael Fork
Тема Re: plpgsql grief
Дата
Msg-id Pine.BSI.4.21.0102121124560.21572-100000@glass.toledolink.com
обсуждение исходный текст
Ответ на Re: plpgsql grief  ("Josh Berkus" <josh@agliodbs.com>)
Список 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 по дате отправления:

Предыдущее
От: Michael Fork
Дата:
Сообщение: Re: Wierd postgres Problem
Следующее
От: Tom Lane
Дата:
Сообщение: Re: plpgsql grief