Re: Using SETOF in plpgsql function
От | Tom Lane |
---|---|
Тема | Re: Using SETOF in plpgsql function |
Дата | |
Msg-id | 27932.967040675@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Using SETOF in plpgsql function (Jan Wieck <janwieck@Yahoo.com>) |
Ответы |
Re: Using SETOF in plpgsql function
|
Список | pgsql-sql |
Jan Wieck <janwieck@Yahoo.com> writes: > hlefebvre wrote: >> I'd like to return a set of integer in an pl/pgsql function. How can I >> do that ? > You can't. Not with PL/pgSQL nor with any other PL or C. The > problem is nested deeper and requires the planned querytree > redesign to get solved. Not really. Coincidentally enough, I am just in the middle of removing execQual.c's hard-wired assumption that only SQL-language functions can return sets. (This is a side effect of fixing the function manager so that SQL functions can be called in all contexts, eg used as index functions.) If you want to fix plpgsql so that it retains state and can produce multiple elements of a set over repeated calls, the same way that SQL functions do, then it could be done today. We may well want to rip out that whole approach to set functions later when we redo querytrees, but the real limitation so far has been bogus assumptions in the function-call API, not querytrees. regards, tom lane
В списке pgsql-sql по дате отправления: