Set Default PostgreSQL Character Encoding

The only way I’ve found to set the default character encoding on a PostgreSQL database server is when initializing the database. The -E parameter is used like so:

initdb -E UTF8

This will setup the database cluster to default to UTF-8.

Note that on Ubuntu, the initdb program is not in the path. Instead, it’s tucked away at:

/usr/lib/postgresql/8.2/bin/initdb.

References:

http://www.postgresql.org/docs/8.1/static/multibyte.html
http://ubuntuforums.org/showthread.php?t=694887

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s