Tom Hart wrote:
> Hello everybody. I recently converted my db from ASCII encoding to UTF8  
> (we have a lot of spanish-speaking members, and need the extra character  
> support). Everything was working great, but I noticed this error, while  
> trying to COPY one of our tables from a csv.
>
> ERROR: invalid byte sequence for encoding "UTF8": 0xb9
> SQL state: 22021
> Hint: This error can also happen if the byte sequence does not match the  
> encoding expected by the server, which is controlled by 
> "client_encoding".
> Context: COPY transaction_import, line 59358

Did you try setting client_encoding beforehand?  I think a simple

PGOPTIONS="client_encoding=latin9" pg_restore ...

should suffice.

Now, if you have mixed UTF8 and Latin1/Latin9 data, you are hosed
(meaning you'll have to wade through the stuff and figure out what data
is in what encoding, and fix it).

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to