Christoph Haller <ch@rodos.fzk.de> writes:
> What else seems to work is MOVE 2147483647
> (INT_MAX) and then get the max number of rows
> by PQcmdTuples().
I'd suggest "MOVE FORWARD ALL" rather than hard-wiring assumptions
about the maximum possible value of infinity ;-)
> But I have no idea how expensive this MOVE is.
The rows are all calculated internally --- about all you save compared
to a FETCH is data formatting and transmission. If you really have to
know this number in advance of fetching the data, that's pretty much
what you have to do, but it will cost you ...
regards, tom lane