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 of large |
Date: | 2012-04-04 22:40:37 |
Message-ID: | E1SFYsX-0004jp-D2@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
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
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(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2012-04-05 01:50:42 | pgsql: Fix plpgsql named-cursor-parameter feature for variable name con |
Previous Message | Tom Lane | 2012-04-04 20:15:31 | pgsql: Remove useless PGRES_COPY_BOTH "support" in psql. |