Re: COPY and Unicode...

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Cristian Prieto" <cristian(at)clickdiario(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: COPY and Unicode...
Date: 2005-09-21 20:47:57
Message-ID: 21761.1127335677@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Cristian Prieto" <cristian(at)clickdiario(dot)com> writes:
> Hello, I need to import some amount of data using the COPY command, the main
> trouble I found is that the Database is in UNICODE format and the data in
> ASCII Latin-1 codepage, when I try to import it, COPY respond with:

> ERROR: invalid byte sequence for encoding "UNICODE": 0xe9
> CONTEXT: COPY geoip_location, line 307, column city: "Yaound"

> I've been looking into the documentation and I could not found any reference
> in copy from a distinct codepage than the used by the database, any help?

Try doing "SET client_encoding = latin1" before doing the COPY.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Fetter 2005-09-21 20:57:05 Re: YAPC::Israel looking for Perl/Database speakers
Previous Message Douglas McNaught 2005-09-21 20:38:48 Re: COPY and Unicode...