Re: set-valued function called in context that cannot accept a set

Поиск
Список
Период
Сортировка
От Eric B. Ridge
Тема Re: set-valued function called in context that cannot accept a set
Дата
Msg-id B173B9A4-DC16-4E09-B0ED-3A2C11B2C8E7@tcdi.com
обсуждение исходный текст
Ответ на Re: set-valued function called in context that cannot accept a set  (Raymond O'Donnell <rod@iol.ie>)
Ответы Re: set-valued function called in context that cannot accept a set  (hubert depesz lubaczewski <depesz@depesz.com>)
Список pgsql-general
On Mar 6, 2009, at 3:27 PM, Raymond O'Donnell wrote:

> When a function returns SETOF something, you need to treat it as if it
> were a table, thus:
>
>   select * from unnest2(...);

Except that isn't true if the function is written in C.

CREATE OR REPLACE FUNCTION unnest(anyarray)
RETURNS SETOF anyelement AS 'unnest'
LANGUAGE 'C' IMMUTABLE;

    SELECT unnest(...);

works just fine using the above defined C function.

So my question is really, what's the difference and why doesn't this
work with PL/PGSQL functions?

eric

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

Предыдущее
От: Raymond O'Donnell
Дата:
Сообщение: Re: set-valued function called in context that cannot accept a set
Следующее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: set-valued function called in context that cannot accept a set