sudo -u postgres psql -l
sudo apt-get purge postgresqlsudo apt-get install postgresql
sudo -u postgres psql -c "SHOW SERVER_ENCODING"
My fix was to just blow away the default cluster and re-create it with a UTF8 encoding. It should go without saying that you shouldn’t do this on a server with data you’d actually like to keep, but on a new server this works fine:
pg_dropcluster --stop 8.4 main
pg_createcluster --start -e UTF-8 8.4 main
If someone knows of an easier way — one that doesn’t require destroying data — I’d love to know about it.
John Chewter said:I had to remake the cluster as above too in 2.5 - but substituting 9.1 for 8.4
It seems this could be fixed by the install script forcing UTF-8 at database creation time - or so the PostgreSQL Docs infer.
It looks like you're new here. If you want to get involved, click one of these buttons!