aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/psql/copy.c5
1 files changed, 5 insertions, 0 deletions
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)
{