Re: C function accepting/returning cstring vs. text

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: C function accepting/returning cstring vs. text
Дата
Msg-id 4B605749.4070000@dunslane.net
обсуждение исходный текст
Ответ на Re: C function accepting/returning cstring vs. text  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Ответы Re: C function accepting/returning cstring vs. text  (Ivan Sergio Borgonovo <mail@webthatworks.it>)
Список pgsql-hackers

Ivan Sergio Borgonovo wrote:
> I just learned there is a "return all row" mode for returning set
> functions:
> "
> There are currently two modes in which a function can return a set
> result: value-per-call, or materialize.  In value-per-call mode, the
> function returns one value each time it is called, and finally
> reports "done" when it has no more values to return.  In materialize
> mode, the function's output set is instantiated in a Tuplestore
> object; all the values are returned in one call. Additional modes
> might be added in future"
>
> There is no example of a function working in this mode.
> I'd guess it should be suited for quick operation and small return.
> But... what should be considered quick and small?
> When someone should use a "row at a time" function and a "return all
> row" function?
>   

There are quite a few SRF functions in the code. Look for example in 
contrib/hstore/hstore_op.c for some fairly simple examples.
SRFs are quite capable of returning huge resultsets, not just small 
ones. Example code for matrerialize mode can be found in the PLs among 
other places (e.g. plperl_return_next() )

cheers

andrew


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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Remove tabs in SGML.
Следующее
От: Ivan Sergio Borgonovo
Дата:
Сообщение: Re: C function accepting/returning cstring vs. text