Re: BUG #14251: COPY CSV: missing data for column that shouldn't be - Mailing list pgsql-bugs

From John R Pierce
Subject Re: BUG #14251: COPY CSV: missing data for column that shouldn't be
Date
Msg-id 81b92ba9-0ef8-3b24-7c6c-6fca17c92655@hogranch.com
Whole thread Raw
In response to BUG #14251: COPY CSV: missing data for column that shouldn't be  (mickael.kerjean@gmail.com)
List pgsql-bugs
On 7/14/2016 7:03 PM, mickael.kerjean@gmail.com wrote:
> "af,dekh"iykh'ya,Dekh"iykh'ya,13,,34.60345,69.2405"
> => The csv is valid but postgres doesn't really get it right

the quotes don't make much sense at all.

     country_code = "af
     city = dekh"iykh'ya
     city_accent = Dekh"iykh'ya
     region = 13
     population = NULL
     lat = 34.60345
     lng = 69.2405"



is dekh"iykh'ya  supposed to be accented characters or something?  If
you don't specify a QUOTE on your COPY command, it defaults to ", this
will definitely mess things up.   you might try specifying a QUOTE '%'
or something that doesn't exist in your data, I don't think you can
disable QUOTE entirely on CSV format copies.

--
john r pierce, recycling bits in santa cruz

pgsql-bugs by date:

Previous
From: mickael.kerjean@gmail.com
Date:
Subject: BUG #14251: COPY CSV: missing data for column that shouldn't be
Next
From: Noah Misch
Date:
Subject: Re: BUG #14245: Segfault on weird to_tsquery