Add C comment about \copy bug in CSV mode
authorBruce Momjian <[email protected]>
Thu, 4 Jul 2013 17:09:52 +0000 (13:09 -0400)
committerBruce Momjian <[email protected]>
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/[email protected]

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/[email protected]
+                                        */
                                        if (strcmp(buf, "\\.\n") == 0 ||
                                                strcmp(buf, "\\.\r\n") == 0)
                                        {