Re: pl/pgsql Limits

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: pl/pgsql Limits
Дата
Msg-id 2300.979407081@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: pl/pgsql Limits  (Jan Wieck <janwieck@Yahoo.com>)
Список pgsql-sql
Jan Wieck <janwieck@Yahoo.com> writes:
>> As it is known that any funtion, written in pl/pgsql, can only
>> retrun one tuple. I am just wondering  it were true as well for function
>> written in C language. I need to write few function that will retrun
>> mulitiple rows satsifying a certain set of conditions.

>     We plan to tackle the problem for v7.2.

It is possible for a C function to return a set (ie, multiple values
returned over successive calls) as of 7.1; it's even documented, see
src/backend/utils/fmgr/README.  And you can return a tuple if you know
how (this part is not documented, but you can crib it from the
SQL-function support in backend/executor/functions.c).

The real problem is that the rest of the system doesn't let you *do*
anything very useful with either set-valued or tuple-valued functions.
This is what we need to address in future releases.  Ideally I think
a function returning sets and/or tuples should be treated as a table
source, so that you'd write ... FROM function(args) AS alias, ...
        regards, tom lane


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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: pl/pgsql Limits
Следующее
От: bartschm@psi.com
Дата:
Сообщение: how to select a time frame on timestamp rows.