Postgresql Encoding – UTF8
Monday, June 9th, 2008 By: jamesOver the past many years I have been involved in projects requiring localization into many different languages. One issue with this is how data is stored in the database.
As we support and help various customers with Postgresql related database issues, we still find users who are encoding their databases in SQL_ASCII. Perhaps there is a reason for this, if there is I haven’t figured it out yet.
In many cases, this eventually causes them problems and they end up having to switch from SQL_ASCII or some other encoding over to UTF8.
There may be more, but I know of two different ways of converting the encoding of the database to UTF8.
One way is
iconv -f iso-8859-1 -t utf-8 dump_file dump_file_recoded
The preferred way however is to use the -E option of the pg_dump command like this:
pg_dump -U postgres -W -E UTF8 -d pg_bench >pgbench.backup.the -W command forces you to put in a password.
For more details on how to use the pg_dump command, here are the docs:
http://www.postgresql.org/docs/8.3/interactive/app-pg_dump.html

The Sevier River Water Users Association (SRWUA) in Central Utah are pioneers in the use of the Real-Time Web. For the past 10 years SRWUA has been delivering real-time water flow data to the public via the website www.SevierRiver.org.
More that 100 remote, solar-powered, stations record wate...