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

Change the character encoding of a database

From: Ivo Rossacher <rossacher(at)bluewin(dot)ch>
To: pgsql-admin(at)postgresql(dot)org
Subject: Change the character encoding of a database
Date: 2004-06-28 21:38:24
Message-ID: 200406282338.25074.rossacher@bluewin.ch (view raw or flat)
Thread:
Lists: pgsql-admin
Hi All,

I do have a database which was created with the encoding SQL_ASCII and used 
with German, French and Italien strings. Until recently there was only a 
Linux client, an all worked fine (Suse 8.1). Now there is a new Windows 
client which does have a different idea of the encoding. I did some tests and 
found out that the encoding UNICODE does work properly for both clients.
The question now is how to change the encoding of database from SQL_ASCII to 
UNICODE?

I did try to dump the database by pgdump database > dump.dmp, droped the 
database, recreate it with the encoding UNICODE and restore the dump by psql 
database < dump.dmp which worked after some small changes (change the client 
encoding to UNICODE) in the dump.dmp. Without the changes in the dump.dmp 
there was a error message about invalide codes and no import at all. With the 
changes there are still some encoding mistakes (wrong signes in the strings) 
but the import basically works. The server actually runs on the same machine 
as the client (Suse 8.1). I think there is a problem with the import because 
the linux system is not set to use UNICODE. Is there an way to get the data 
converted correctly?
-- 
Ivo Rossacher

Responses

pgsql-admin by date

Next:From: Bender, CherylDate: 2004-06-28 21:41:46
Subject: Re: pg_ctl question
Previous:From: Peter EisentrautDate: 2004-06-28 21:32:42
Subject: Re: pg_ctl question

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