Mark Harrison <mh@pixar.com> writes:
> I can't seem to get PG into non-blocking mode.
"Non-blocking" does not mean "will deliver an incomplete result".
It just means you can get control back while waiting for the complete
result (though not with the code you show...)
You probably want to think about creating a cursor and FETCHing
a few rows per query.
regards, tom lane