Re: recursive call to function returning SETOF

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: recursive call to function returning SETOF
Дата
Msg-id 20030915111955.K69836@megazone.bigpanda.com
обсуждение исходный текст
Ответ на recursive call to function returning SETOF  ("Max Nachlinger" <nachlinger@hotmail.com>)
Список pgsql-novice
On Mon, 15 Sep 2003, Max Nachlinger wrote:

> Hello all,
>
> I�m attempting to write a function in plpgsql (for PostgreSQL 7.3.4) to
> power a threaded discussion forum, and am having difficulties calling the
> function in question recursively.  The function returns a SETOF (see the
> function definition below) a custom type I created to hold a row of data.
> I�d be grateful if anyone could share their experiences calling functions
> returning a SETOF recursively.

I think you'd need to call it like
FOR record IN SELECT * from get_posts(post.post_id) LOOP
 RETURN NEXT record;
END LOOP;

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Vacuum runs in a loop?
Следующее
От: Wim
Дата:
Сообщение: Re: Vacuum runs in a loop?