Eliot Gable <egable+pgsql-general(at)gmail(dot)com> writes:
> Inside my PL/PGSQL stored procedure, I am opening the cursor like so:
> OPEN source_host;
> FETCH source_host INTO src_host;
So you already fetched the one row in the cursor. FETCH ALL really
means "fetch all the rest of the rows", which is why it returns nothing.
The other variants you mention will reposition the cursor so they can
re-read the row.
> I absolutely need to have FETCH ALL working.
It is working. What you're not doing correctly is repositioning the
cursor to before the first row. Try MOVE BACKWARDS ALL.
regards, tom lane