Gnuru.org
Adventures in Linux


Converting a Postgresql Database to UTF
24 June 2008 @ 11:18 BST
by Paul


Postgresql databases default to an encoding style of ASCII. Although this is traditional, UTF8, an encoding that can handle almost any language and character set, is preferable. This is how to convert an existing postgresql database to utf8:


pg_dump asciidatabase > ascii.sql
iconv -f iso8859-1 -t utf-8 < ascii.sql > utf.sql
createdb --encoding=unicode utfdatabase
psql utfdatabase < utf.sql

It worked for me, anyway!



Leave a comment:

Are you human?