Productive Linux


 Subscribe via Feedburner in a reader

Enter your email address:

Delivered by FeedBurner


Don't have an account?
Sign up to
Forgot your password?

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!

Comments disabled