Tuesday, February 9, 2010

Postgres and utf8

Recently I discovered that my postgres datbase is not running with UTF-8 support which causes all kinds of headdache,

so what do you have todo to change this?

  • backup your database
  • set Lang to: LANG = en_US.UTF-8
  • execute initdb
  • recreate the database and specify the encoding: createdb --encoding=unicode
  • import your data

you should now have a working utf-8 database

No comments:

Post a Comment