concatenating setof functions

Поиск
Список
Период
Сортировка
От Frederick Ross
Тема concatenating setof functions
Дата
Msg-id b91043270704161230u2e3aeee3q1519194220600f10@mail.gmail.com
обсуждение исходный текст
Ответы Re: concatenating setof functions
Список pgsql-general
I suspect I am missing a much cleaner way of doing this, but say I
have a function which returns a setof integer, i.e.,

create or replace function testfunc (integer) returns setof integer as $$
declare
     i alias for $1;
begin
     return next i;
     return next i+100;
     return;
end
$$ language plpgsql;

I know I can call this as: select * from twohundreds(3);

But say I have a table with an integer column.  If I had a pure SQL
function, I could call

select twohundreds(i) from table;

and get a properly concatenated list of the rows resulting from
applying twohundreds to each row of table.  This is deprecated
according to the documentation, and it doesn't work at all with
PLPGSQL, so how should I go about doing it?

--
Frederick Ross
Graduate Fellow, (|Siggia> + |McKinney>)/sqrt(2) Lab
The Rockefeller University
Je ne suis pas Fred Cross!

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pg_dump seg fault on sequences
Следующее
От: Tom Lane
Дата:
Сообщение: Re: concatenating setof functions