Postgresql: Installing Postgresql 8.4.x on CentOS

March 23rd, 2010 by jeremychone

Get the YUM repository

$ wget http://yum.pgsqlrpms.org/reporpms/8.4/pgdg-centos-8.4-2.noarch.rpm
$ rpm -ivh pgdg-centos-8.4-2.noarch.rpm

Filter YUM postgresql

yum list | grep postgresql

If you see postgresql from other repositories besides pgdg84, then you need to exclude postgresql from coming from other repositories by following the below instructions excerpted from PostgreSQL How to Yum

  • As root, cd /etc/yum.repos.d
  • Edit distro’s .repo file:
    • On Fedora, edit fedora.repo and fedora-updates.repo, [fedora] sections
    • On CentOS, edit CentOS-Base.repo, [base] and [updates] sections.
    • On Red Hat, edit edit /etc/yum/pluginconf.d/rhnplugin.conf [main] section.

Add to the bottom of the section:

exclude=postgresql*

Yum Install

yum install postgresql-server

Init database

service postgresql initdb

Make it autostart

chkconfig postgresql on

Create the first DBTest

su - postgres
createdb DBTest

SQL to DBTest

su - postgres
psql DBTest

All DB files are at

Root directory: /var/lib/pgsql/

Config file: /var/lib/pgsql/data/postgresql.conf

See also:

One Response to “Postgresql: Installing Postgresql 8.4.x on CentOS”

  1. lystor Says:

    Upgrading PostgreSQL 8.1 to 8.4 on CentOS 5.5

Leave a Reply