Force Postgres to install with UTF8 encoding, not LATIN1? Force Postgres to install with UTF8 encoding, not LATIN1? postgresql postgresql

Force Postgres to install with UTF8 encoding, not LATIN1?


This might not be the answer you are looking for, but here are commands which you can use to switch PostgreSQL to a different locale (backup, re-create cluster and restore):

sudo -u postgres pg_dumpall > /tmp/postgres.sqlsudo pg_dropcluster --stop 9.1 mainsudo pg_createcluster --locale en_US.UTF-8 --start 9.1 mainsudo -u postgres psql -f /tmp/postgres.sql

If you want to know why the installation uses Latin, then you might need to dig into installation scripts. But if en_US.UTF-8 is not your default system locale, that might be the problem. Installation script can be loading /etc/default/locale.