My system's locale is en_US.UTF-8. Because of that, the postgreSQL installation uses this locale by default for the cluster during installation.
Creating new cluster 9.3/main ... config /etc/postgresql/9.3/main data /var/lib/postgresql/9.3/main locale en_US.UTF-8 port 5432But I want my postgreSQL server to install with locale pt_BR.UTF-8. Is it possible?
2 Answers
I just found a solution for this problem! Here it is..
1- Stop and drop your current cluster:
$ sudo pg_dropcluster --stop 9.3 main2- Create a new cluster with the correct locale:
$ sudo locale-gen pt_BR.UTF-8
$ sudo pg_createcluster --locale pt_BR.UTF-8 9.3 main3- Confirm it worked as expected:
$ sudo -u postgres psql
(9.3)
=> show LC_COLLATE; Simply install it using below commands :
sudo apt-get update
sudo apt-get install postgresql postgresql-contriband then change the datastorage location :
/etc/postgresql/<VERSION>/main/postgresql.confeg : vi /etc/postgresql/8.4/main/postgresql.conf
Search for "data_directory" and provide your new datapath, now save the file and restart the postgresSQL service to reflect this new change.
Considered : your new path is /Database/Storage
Make sure, datapath is accessible only by postgres user - command to do that.
chown postgres.postgres /Database/Storage chmod 700 /Database/Storage
Hopes this helps,
1