Re: recursive call to function returning SETOF - Mailing list pgsql-novice

From Stephan Szabo
Subject Re: recursive call to function returning SETOF
Date
Msg-id 20030915111955.K69836@megazone.bigpanda.com
Whole thread Raw
In response to recursive call to function returning SETOF  ("Max Nachlinger" <nachlinger@hotmail.com>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Vacuum runs in a loop?
Next
From: Wim
Date:
Subject: Re: Vacuum runs in a loop?