Re: BUG #14251: COPY CSV: missing data for column that shouldn't be

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #14251: COPY CSV: missing data for column that shouldn't be
Date: 2016-07-15 06:12:26
Message-ID: 81b92ba9-0ef8-3b24-7c6c-6fca17c92655@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 7/14/2016 7:03 PM, mickael(dot)kerjean(at)gmail(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Noah Misch 2016-07-15 06:42:18 Re: BUG #14245: Segfault on weird to_tsquery
Previous Message mickael.kerjean 2016-07-15 02:03:34 BUG #14251: COPY CSV: missing data for column that shouldn't be