aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2006-01-25 20:44:49 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2006-01-25 20:44:49 +0000
commitf31a58481c209d70f6c1ff7123fe77071941afe9 (patch)
treec049bafc42f79360e2d67fc999d86d2dae6b8aba /src
parentb34608fbdda2b872b35400075f724f12aa4f6b13 (diff)
downloadpostgresql-f31a58481c209d70f6c1ff7123fe77071941afe9.tar.gz
postgresql-f31a58481c209d70f6c1ff7123fe77071941afe9.zip
Remove unnecessary PQconsumeInput call from PQputCopyData; it's redundant
because pqSendSome will absorb input data anytime it'd be forced to block. Avoiding a kernel call per PQputCopyData call helps COPY speed materially. Alon Goldshuv
Diffstat (limited to 'src')
-rw-r--r--src/interfaces/libpq/fe-exec.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c
index c13f32836de..d8f88166b3c 100644
--- a/src/interfaces/libpq/fe-exec.c
+++ b/src/interfaces/libpq/fe-exec.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.176.2.1 2005/11/22 18:23:29 momjian Exp $
+ * $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.176.2.2 2006/01/25 20:44:49 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1476,13 +1476,13 @@ PQputCopyData(PGconn *conn, const char *buffer, int nbytes)
}
/*
- * Check for NOTICE messages coming back from the server. Since the
- * server might generate multiple notices during the COPY, we have to
- * consume those in a reasonably prompt fashion to prevent the comm
- * buffers from filling up and possibly blocking the server.
+ * Process any NOTICE or NOTIFY messages that might be pending in the
+ * input buffer. Since the server might generate many notices during
+ * the COPY, we want to clean those out reasonably promptly to prevent
+ * indefinite expansion of the input buffer. (Note: the actual read
+ * of input data into the input buffer happens down inside pqSendSome,
+ * but it's not authorized to get rid of the data again.)
*/
- if (!PQconsumeInput(conn))
- return -1; /* I/O failure */
parseInput(conn);
if (nbytes > 0)