Pages

Sunday, June 1, 2014

Installing PostgreSQL 9.3 on CentOS 6.5

PostgreSQL Installation

Basically, to install the latest version of PostgreSQL (9.3 as I write), you can follow the instructions in the PostgreSQL Wiki.

Post-installation commands

Initialize

Here is a difference from the wiki: I customize the call to the PostgreSQL script initdb (adapt the paths if needed):
sudo -u postgres /usr/pgsql-9.3/bin/initdb --pgdata=/var/lib/pgsql/9.3/data -E 'UTF-8'
Explanations:
  • sudo -u postgres : I run the initdb script with the user postgres. Thus, all the data files in /var/lib/pgsql/9.3/data will have postgres as owner.
  • -E 'UTF-8' : I set the database encoding to UTF-8 instead of ASCII.

Startup

You can check that the service is enable for startup:
sudo chkconfig --list postgresql-9.3
And turn it on if needed:
sudo chkconfig  postgresql-9.3 on

Control Service

Start the service:
sudo service postgresql-9.3 start

No comments:

Post a Comment