On Nov 28, 2007 10:51 AM, Martijn van Oosterhout <kleptog@svana.org> wrote:
> The trick was to set non-blocking mode and send an async query. Then
> PQisBusy() would return false when any data had been received, not just
> when all data had been received. At that point you could call
> PQgetResult to get those rows. You would get a zero-length result when
> you reached the end of data.
>
> Admittedly, I havn't tested it on recent versions. The program I posted
> a while back that tested if the locks blocked as documented drove two
> connections simultaneously this way.
>
> http://archives.postgresql.org/pgsql-hackers/2005-08/msg01073.php
> http://archives.postgresql.org/pgsql-general/2006-07/msg00806.php
aiui, PQgetResult does not allow streaming of partial results. it does
however allow returning multiple results for multiple queries sent in
a batch...so, a 'kinda sorta' streaming could be rigged in certain
cases if the big query could be split to multiple queries and chained.
pulling back and using a piece of a single result is not possible,
and never has been. also, there is always the cursor technique which
i only find appealing in very special circumstances.
merlin