Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9b01231

Browse files
committed
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
1 parent3a0a16c commit9b01231

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎src/interfaces/libpq/fe-exec.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.178 2006/01/11 08:43:13 neilc Exp $
11+
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-exec.c,v 1.179 2006/01/25 20:44:32 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -1476,13 +1476,13 @@ PQputCopyData(PGconn *conn, const char *buffer, int nbytes)
14761476
}
14771477

14781478
/*
1479-
* Check for NOTICE messages coming back from the server. Since the
1480-
* server might generate multiple notices during the COPY, we have to
1481-
* consume those in a reasonably prompt fashion to prevent the comm
1482-
* buffers from filling up and possibly blocking the server.
1479+
* Process any NOTICE or NOTIFY messages that might be pending in the
1480+
* input buffer. Since the server might generate many notices during
1481+
* the COPY, we want to clean those out reasonably promptly to prevent
1482+
* indefinite expansion of the input buffer. (Note: the actual read
1483+
* of input data into the input buffer happens down inside pqSendSome,
1484+
* but it's not authorized to get rid of the data again.)
14831485
*/
1484-
if (!PQconsumeInput(conn))
1485-
return-1;/* I/O failure */
14861486
parseInput(conn);
14871487

14881488
if (nbytes>0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp