Install PostgreSQL 9.0.x on CentOS

Posted on Tue 19 April 2011 in CentOS

This tutorial explains how to install PostgreSQL from the official PostgreSQL repository. This method allows you to install newer versions of PostgreSQL for example 9.0 if you need the newest cluster functionality delivered with upcoming PostgreSQL 9.1 you need to build the software manual as long as there is no 9.1 repository available.

If you want to install the stable 8.4 version delivered with CentOS I wrote this tutorial.

1. Download yum repository rpm for your arch and version you want to use:
  1. install rpm file
rpm -i <file>.rpm
  1. modify CentOS Repository
vi /etc/yum.repos.d/CentOS-Base.repo

add this line:


should look like this:

name=CentOS-$releasever - Base
  1. install PostgreSQL
yum install postgresql-server

5.initialize PostgreSQL-Database

service postgresql initdb
  1. start service
service postgresql start
  1. if you want postgresql to be started at boot time run this:
chkconfig --levels 35 postgresql on