Search Postgresql Archives

Re: COPY complaining about unquoted carriage return found in data... in a quoted field

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

COPY doesn't like '\n' too.

Replace '\n' by '\\n'

Regards

Pavel Stehule

2011/5/10 Ivan Sergio Borgonovo <mail@xxxxxxxxxxxxxxx>:
> I'm on pg 8.3.14
> I'm trying to import a csv with
>
> \copy anagraficaclienti from
> Â'myfile.csv'
> Âdelimiter as E' Â Â Â ' Â-- this is a tab \t
> Ânull as 'NULL'
> Âcsv
> Â Âheader
> Â Âquote as E'"'
> Â Âescape as E'\\'
>
> What I get is
>
> ERROR: Âunquoted carriage return found in data
> HINT: ÂUse quoted CSV field to represent carriage return.
> CONTEXT: ÂCOPY anagraficaclienti, line 48656
>
> The record actually contains \r\n in a field but up to my
> understanding that field is quoted.
> I think what seems to be wrong is my understanding of what postgres
> consider quoted field.
>
> the content in hex
> 09 22 56 | 69 61 20 46 | 61 65 6E 74 | 69 6E 61 2C
> 20 35 33 0D | 0A 22 09 22 | 35 30 30 31 | 34 22 09
>
> \t"Via Faentina, 53\r\n"\t
>
> What am I missing?
>
> --
> Ivan Sergio Borgonovo
> http://www.webthatworks.it
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux