pgsql: Add a "row processor" API to libpq for better handling of large - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Add a "row processor" API to libpq for better handling of large
Date
Msg-id E1SFYsX-0004jp-D2@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/92785dac2ee7026948962cd61c4cd84a2d052772

Modified Files
--------------
doc/src/sgml/libpq.sgml             |  268 +++++++++++++++++++++++++++++
src/interfaces/libpq/exports.txt    |    3 +
src/interfaces/libpq/fe-connect.c   |   12 +-
src/interfaces/libpq/fe-exec.c      |  177 ++++++++++++++++++-
src/interfaces/libpq/fe-lobj.c      |   40 +++--
src/interfaces/libpq/fe-misc.c      |   26 +++
src/interfaces/libpq/fe-protocol2.c |  325 ++++++++++++++++++++++++++---------
src/interfaces/libpq/fe-protocol3.c |  298 +++++++++++++++++++++++----------
src/interfaces/libpq/libpq-fe.h     |   31 +++-
src/interfaces/libpq/libpq-int.h    |   14 ++-
10 files changed, 992 insertions(+), 202 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Remove useless PGRES_COPY_BOTH "support" in psql.
Next
From: Tom Lane
Date:
Subject: pgsql: Improve efficiency of dblink by using libpq's new row processor