Open GoogleCodeExporter opened 9 years ago
PostgreSQL has a single-row mode in which you can fetch one row of a result set
at a time. To invoke this, start the query asynchronously with PQsendQuery(),
then call PQsetSingleRowMode(). Now calls to PQgetResult() will return only
one row at a time.
Original comment by bmusi...@aptecgroup.com
on 27 May 2013 at 10:59
1
dbSendQuery() and fetch() combination exist just for the compatibility to the
codes using it. This is not designed to work in the way you thought. It should
work if you have sufficient memory. Otherwise, that is unlucky.
2, 3
dbSendQuery() submits and synchronously executes the SQL statement and have to
return result set object. PQsendQuery() just send the SQL and let them work
asynchronously without waiting for the result(s). There is no function to fetch
a certain amount of rows after PQsendQuery() either. That is the result set
batch size is not controllable, anyway. PQsetSingleRowMode appeared at version
9.2. This is too new to use as a default behavior in a library.
4 You may consider using OFFSET and LIMIT instead of WHERE to construct queries
to return some limited number of records you like.
Original comment by tomoa...@kenroku.kanazawa-u.ac.jp
on 11 Jun 2013 at 2:46
Original issue reported on code.google.com by
bmusi...@aptecgroup.com
on 24 May 2013 at 3:53