COPY error when \. char

From: Nicolas Paris <niparisco(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: COPY error when \. char
Date: 2018-03-20 11:32:04
Message-ID: 20180320113204.n3rto7iyekqkzmz4@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

I get an error when loading this kind of csv:

> test.csv:
"hello ""world"" "
"\."
"this
works
"
"this
\.
does
not"

> table:
create table test (field text);

> sql:
\copy test (field) from 'test.csv' CSV quote '"' ESCAPE '"';
ERROR: unterminated CSV quoted field
CONTEXTE : COPY test, line 7: ""this
"

Apparently, having the \. string in a single line make it break.
Is this normal ?

Thanks

Responses

Browse pgsql-general by date

  From Date Subject
Next Message HORDER Phil 2018-03-20 11:46:21 Foreign Key locking / deadlock issue.
Previous Message Laurenz Albe 2018-03-20 10:34:16 Re: You might be able to move the set-returning function into a LATERAL FROM item.