]> granicus.if.org Git - postgresql/commitdiff
Add C comment about \copy bug in CSV mode
authorBruce Momjian <bruce@momjian.us>
Thu, 4 Jul 2013 17:09:52 +0000 (13:09 -0400)
committerBruce Momjian <bruce@momjian.us>
Thu, 4 Jul 2013 17:09:52 +0000 (13:09 -0400)
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

src/bin/psql/copy.c

index b5732c797097c836fa55824c8097c1efd6d40fb1..c1e7cfeb8af75441513821f5b29871bb50fa8b90 100644 (file)
@@ -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)
                                        {