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;