Skip site navigation (1) Skip section navigation (2)

pgsql: Add a "row processor" API to libpq for better handling oflarge

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add a "row processor" API to libpq for better handling oflarge
Date: 2012-04-04 22:40:37
Message-ID: (view raw, whole thread or download thread mbox)
Lists: 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



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

Next:From: Tom LaneDate: 2012-04-05 01:50:42
Subject: pgsql: Fix plpgsql named-cursor-parameter feature for variable namecon
Previous:From: Tom LaneDate: 2012-04-04 20:15:31
Subject: pgsql: Remove useless PGRES_COPY_BOTH "support" in psql.

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group