Re: WIP patch: convert SQL-language functions to return tuplestores

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: WIP patch: convert SQL-language functions to return tuplestores
Дата
Msg-id 162867790810310112u27c7469bs47006b4904c928d5@mail.gmail.com
обсуждение исходный текст
Ответ на Re: WIP patch: convert SQL-language functions to return tuplestores  ("Robert Haas" <robertmhaas@gmail.com>)
Ответы Re: WIP patch: convert SQL-language functions to return tuplestores  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
2008/10/30 Robert Haas <robertmhaas@gmail.com>:
>> With session variables we could implement srf function in plpgsql like
>> current C srf function. Like
>>
>> create or replace function foo(....)
>> returns record as $$
>> #option with_srf_context(datatype of srf context)
>> begin
>>   return row(...);
>> end;
>> $$ language plpgsql;
>
> Oh, sure - but what you can do with this will be somewhat limited
> compared to a Perl hash reference off which you can chain any
> arbitrary data structure with ease.  I'd want to see an actual use
> case for this before anyone bothered implementing it.  I was actually
> thinking one way to do it would be to extend the variable declaration
> syntax so that you could declare n>=0 variables as SRF context
> variables, which I think is nicer, but even that I think is of limited
> usefulness.  I think the biggest value of PL/plgsql is the ability to
> RETURN QUERY, and I think the ability to push a lazy execution model
> down into that subordinate query is where the win is.  That case won't
> be helped at all by this sort of alternate calling convention - in
> fact it'll be nearly impossible to even do that at all with this type
> of execution model.
>

RETURN QUERY should be implemented for lazy execution model. And it
should be fast and not to much dificult.

Pavel


> ...Robert
>


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: PG_PAGE_LAYOUT_VERSION 5 - time for change
Следующее
От: KaiGai Kohei
Дата:
Сообщение: Updates of SE-PostgreSQL 8.4devel patches (r1168)