Re: \COPY from CSV ERROR: unterminated CSV quoted field - Mailing list pgsql-general

From Tom Lane
Subject Re: \COPY from CSV ERROR: unterminated CSV quoted field
Date
Msg-id 10837.1403211919@sss.pgh.pa.us
Whole thread Raw
In response to \COPY from CSV ERROR: unterminated CSV quoted field  (ogromm <alex.schiller1990@web.de>)
List pgsql-general
ogromm <alex.schiller1990@web.de> writes:
> I get the error "unterminated CSV quoted field" when I try to copy text with
> "new line \. new line"

> For example:

> CREATE TABLE test (text TEXT);
> \COPY test FROM 'test.csv' WITH DELIMITER ',' CSV HEADER;

> test.csv:
> Text
> "some text
> \.
> more text"

Yeah, psql's \copy command doesn't know anything about CSV mode, and
will take \. as an EOF marker even though it shouldn't.  If you need
to copy data like this I'd suggest using a backend-side COPY.

            regards, tom lane


pgsql-general by date:

Previous
From: Merlin Moncure
Date:
Subject: Re: max_connections reached in postgres 9.3.3
Next
From: Borislav Ivanov
Date:
Subject: Re: max_connections reached in postgres 9.3.3