Change PostgreSQL Locale

wrote by Rafael Marangoni, from Suporte Linux team.

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

facebooktwittergoogle_plusredditlinkedinmail

Leave a Reply

Your email address will not be published. Required fields are marked *


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>