Sebastien FLAESCH <sf@4js.com> writes:
> Is the whole result set fetched to the client app, not matter what row
> number is provided to the first PQgetvalue() call (or similar API call
> on result set data or meta-data)?
I have tested this as well and came to the same result as you.
The entire result set seems to be fetched at once.
Attached is a test program: I have loaded 30MB of random strings
and did a simple SELECT on the random data. I stopped the output
with getchar() and looked at the network traffic and the memory
usage with top(1). Everything gets allocated and fetched at once
as far as I can see.
However, I would not build an application that "depends" on this
behavior. I think that it is better to use a declared cursor and
use FETCH.
--
Christian Barthel <bch@online.de>