From: Bruce Momjian Date: Thu, 4 Jul 2013 17:09:52 +0000 (-0400) Subject: Add C comment about \copy bug in CSV mode X-Git-Tag: REL9_4_BETA1~1370 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=361b94c4b98b85b19b850cff37be76d1f6d4f8f7;p=thirdparty%2Fpostgresql.git Add C comment about \copy bug in CSV mode Comment: This code erroneously assumes '\.' on a line alone inside a quoted CSV string terminates the \copy. http://www.postgresql.org/message-id/E1TdNVQ-0001ju-GO@wrigleys.postgresql.org --- diff --git a/src/bin/psql/copy.c b/src/bin/psql/copy.c index b5732c79709..c1e7cfeb8af 100644 --- a/src/bin/psql/copy.c +++ b/src/bin/psql/copy.c @@ -635,6 +635,11 @@ handleCopyIn(PGconn *conn, FILE *copystream, bool isbinary) /* check for EOF marker, but not on a partial line */ if (firstload) { + /* + * This code erroneously assumes '\.' on a line alone + * inside a quoted CSV string terminates the \copy. + * http://www.postgresql.org/message-id/E1TdNVQ-0001ju-GO@wrigleys.postgresql.org + */ if (strcmp(buf, "\\.\n") == 0 || strcmp(buf, "\\.\r\n") == 0) {