]> granicus.if.org Git - postgresql/commit
Add a "row processor" API to libpq for better handling of large results.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 4 Apr 2012 22:27:56 +0000 (18:27 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 4 Apr 2012 22:27:56 +0000 (18:27 -0400)
commit92785dac2ee7026948962cd61c4cd84a2d052772
treedeb7a2c120978b9f3b85410317271a91b76ad66d
parentcb917e1544612c187c74fed1a990e26820514c8a
Add a "row processor" API to libpq for better handling of large results.

Traditionally libpq has collected an entire query result before passing
it back to the application.  That provides a simple and transactional API,
but it's pretty inefficient for large result sets.  This patch allows the
application to process each row on-the-fly instead of accumulating the
rows into the PGresult.  Error recovery becomes a bit more complex, but
often that tradeoff is well worth making.

Kyotaro Horiguchi, reviewed by Marko Kreen and Tom Lane
doc/src/sgml/libpq.sgml
src/interfaces/libpq/exports.txt
src/interfaces/libpq/fe-connect.c
src/interfaces/libpq/fe-exec.c
src/interfaces/libpq/fe-lobj.c
src/interfaces/libpq/fe-misc.c
src/interfaces/libpq/fe-protocol2.c
src/interfaces/libpq/fe-protocol3.c
src/interfaces/libpq/libpq-fe.h
src/interfaces/libpq/libpq-int.h