Re: Streaming LIBPQ? Sliding Window in LIBPQ? - Mailing list pgsql-general

From Merlin Moncure
Subject Re: Streaming LIBPQ? Sliding Window in LIBPQ?
Date
Msg-id b42b73150711280932h4106a4b6pfa8ef2e7a8a13dc@mail.gmail.com
Whole thread Raw
In response to Re: Streaming LIBPQ? Sliding Window in LIBPQ?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
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

pgsql-general by date:

Previous
From: mgainty@hotmail.com
Date:
Subject: Re: PostgresSQL vs. Informix
Next
From: Magnus Hagander
Date:
Subject: Re: Linux v.s. Mac OS-X Performance