Re: How do I change the server encoding? - Mailing list pgsql-general

From Antti Haapala
Subject Re: How do I change the server encoding?
Date
Msg-id Pine.GSO.4.44.0302261048340.2358-100000@paju.oulu.fi
Whole thread Raw
In response to Re: How do I change the server encoding?  (Joseph Shraibman <jks@selectacast.net>)
List pgsql-general
On Tue, 25 Feb 2003, Joseph Shraibman wrote:

> Peter Eisentraut wrote:
> > Philippe Kiener writes:
> >>
> >>My database should be transform from SQL_ASCII to utf-8
> >>
> >>I have added that line to my dumps:
> >>
> >>SET CLIENT_ENCODING TO 'SQL_ASCII';
> >>
> >>Now when I load the dump into my db, I get that error on tables with text:
> >>
> >>psql:tcom-database.sql:7111: ERROR:  copy: line 1, Invalid UNICODE character
> >>sequence found (0xe96500)
> >
> >
> > The client encoding SQL_ASCII means that the data will be passed through
> > unchanged.  Try setting it to LATIN1.
> >
> I tried with latin1 and it didn't work.

Hmm... still caused errors? I think that because newer dumps have those
\connects, you need to add explicit char set settings after all of those.

The better way would be converting the whole dump with iconv, though.
Iconv comes by default with many unixen. For example command

    iconv -f iso-8859-1 -t utf-8 < text_dump > text_dump_converted

will convert your dump from latin1 to utf-8.

--
Antti Haapala


pgsql-general by date:

Previous
From: Joe Tomcat
Date:
Subject: Re: 7.4?
Next
From: "Peter Alberer"
Date:
Subject: how to recover after harddisk error