Petr Bravenec <pbravenec@solartec.cz> writes:
> FOR rec in select * from foo
> where foo.pid=pid LOOP
> return next rec;
> raise warning ''uid=% pid=%'',rec.uid,rec.pid;
> select into rec * from foo (rec.uid);
> END LOOP;
> return null;
This is simply throwing away the results of the recursive call.
If you are trying to append those results to the outer call's
results, maybe do this:
FOR rec in select * from foo
where foo.pid=pid LOOP
return next rec;
raise warning ''uid=% pid=%'',rec.uid,rec.pid;
FOR rec2 in select * from foo (rec.uid) LOOP
return next rec2;
END LOOP;
END LOOP;
return null;
regards, tom lane