Re: SRF in SFRM_ValuePerCall mode

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: SRF in SFRM_ValuePerCall mode
Дата
Msg-id 11972.1209391640@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: SRF in SFRM_ValuePerCall mode  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Ответы Re: SRF in SFRM_ValuePerCall mode  ("dv @ nabble" <dvnabble@gmail.com>)
Список pgsql-hackers
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:
> dv @ nabble wrote:
>> I am working on implementation of custom "C" SRF for our team. The SRF uses
>> SFRM_ValuePerCall mode. I know that sometimes even in SFRM_ValuePerCall 
>> mode
>> all the rows returned from SRF are "materialized" (for performing JOINs, 
>> for
>> example).

> Yep, they are unfortunately always materialized. Back when set returning 
> functions were implemented, the original patch did actually support true 
> "value per call" mode, where the whole result set was not materialized. 
> However, it was dropped because of some issues I can't remember off the 
> top of my head. The value-per-call API was committed, so that it was 
> already in place when someone gets around to implement the backend 
> support for it.

That's a rather revisionist view of history ;-)  Value-per-call mode has
always been there, just not in nodeFunctionscan.c.

If you're not joining to the function result, and you don't need the
ability to determine its result type on the fly, you could declare it
as returning a specific rowtype and then call it in the targetlist:
select vpc();
        regards, tom lane


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

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: pgstat SRF?
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: we don't have a bugzilla