Change PostgreSQL Locale

On 2011年01月28日, in soft, by netoearth

This article explains how to change the default PostgreSQL Locale. Be careful, because we’re considering that you do not have data on postgresql instance.

First, we need to stop the postgres service (if was not already stopped):

/etc/init.d/postgresql stop
Then we need to remove all data files from postgresql data dir. On RedHat based, that’s the dir:

rm -rf /var/lib/pgsql/data/*
Now we change to postgres user:

su postgres
Creating the initial data, selecting the Locale:

initdb –locale=C /var/lib/pgsql/data
or

initdb –locale=pt_BR.UTF-8 /var/lib/pgsql/data
or your locale

/etc/init.d/postgresql stop
Then, we start postgres service:

/etc/init.d/postgresql start

Tagged with:  

Comments are closed.