Skip site navigation (1) Skip section navigation (2)

Re: Howto read a UTF-8 CSV with COPY?

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Howto read a UTF-8 CSV with COPY?
Date: 2010-11-15 18:10:24
Message-ID: ibrt2g$707$1@reversiblemaps.ath.cx (view raw or flat)
Thread:
Lists: pgsql-novice
On 2010-11-11, Andreas <maps(dot)on(at)gmx(dot)net> wrote:
> Hi,
> I'd like to import some data from ms-office that has text columns with 
> international characters in it.
>
> COPY complains about illegal byte sequences.
>
> When I placed a "set client_encoding = LATIN1" in front of the COPY 
> command, COPY was happy.
> It still didn't work as expected. There were empty attributes in the 
> imported table when there were accent decorated characters in the source 
> file.

latin-1 was probably the wrong client encoding unless it was office on
a really old Mac.

> Is there a way to import UTF8 encoded csv files ?

copy.
but the files must be utf8, close is noy good enough.

what sequence is it complaining about?

-- 
⚂⚃ 100% natural

In response to

Responses

pgsql-novice by date

Next:From: Jasen BettsDate: 2010-11-15 18:18:38
Subject: Re: login error - Warning: pg_connect(): Unable to connect to PostgreSQL server: FATAL: password authentication failed for user "kamik"
Previous:From: peterDate: 2010-11-15 14:47:01
Subject: Re: Could not open relation with OID (table partitioning issue?)

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group