postgresqlunicode

How do you change the character encoding of a postgres database?


I have a database that was set up with the default character set SQL_ASCII. I want to switch it to UNICODE. Is there an easy way to do that?


Solution

  • To change the encoding of your database:

    1. Dump your database
    2. Drop your database,
    3. Create new database with the different encoding
    4. Reload your data.

    Make sure the client encoding is set correctly during all this.

    Source: http://archives.postgresql.org/pgsql-novice/2006-03/msg00210.php