On Jul 26, 2009, at 4:02 PM, Eric B. Ridge wrote:
> I'm just a random lurker, but FOUND seems to work just fine (I
> suppose it's PG-specific?).
>
> http://www.postgresql.org/docs/8.1/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS
>
> BEGIN
> OPEN stuff;
> FETCH stuff INTO rec;
> WHILE FOUND LOOP
> RETURN NEXT rec;
> FETCH stuff INTO rec;
> END LOOP;
> END;
Yep, that's just what I needed, thanks. I think I'll send a patch for
the "Cursors" section of the PL/pgSQL documentation that mentions
this. Would have saved me a bunch of hassle.
Best,
David