Antes de tudo vamos corrigir o locale
sudo apt-get remove postgresql -y
sudo apt-get install postgresql libpq-dev -y
Substitua a linha local all postgres peer
por local all postgres md5
no arquivo /etc/postgresql/9.1/main/pg_hba.conf
Reinicie o postgres com o comando sudo service postgresql restart
Adicione essas linhas no final do arquivo /etc/bash.bashrc
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Execute os comandos:
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
Antes de tudo vamos corrigir o locale
Adicione essas linhas no final do arquivo /etc/bash.bashrc
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Execute os comandos:
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
sudo apt-get remove postgresql-9.1 -y
sudo apt-get install postgresql-9.1 libpq-dev -y
Substitua a linha local all postgres peer
por local all postgres md5
no arquivo /etc/postgresql/9.1/main/pg_hba.conf
####Restart
sudo