How to install PostgreSQL 8.4 on CentOS 5.5

postgresql reset statistics, pg_stat_reset

If you have tried installing PostgreSQL database on CentOS 5.5 using yum, you will notice that you an old, outdated version! There are several ways to get the 8.4.x version of Postgres installed on this OS, but here is the quick and easy method!

Installing PostgreSQL 8.4.x on CentOS 5.5

  • Download the PostgreSQL 8.4 repository RPM
  • Add the repository
    rpm -ivh pgdg-centos-8.4-2.noarch.rpm
  • Use yum to install PostgresSQL
    yum install -y postgresql postgresql-server
  • Initialize the database
    service postgresql initdb
  • Start the database
    service postgresql restart
  • Automatically start database on boot
    chkconfig postgresql on
See also  How to see active SQL queries and open connections in Postgres?

3 thoughts on “How to install PostgreSQL 8.4 on CentOS 5.5”

  1. When service postgresql initdb:

    If (“Data directory is not empty”)
    rm -f -r /usr/local/pgsql/data
    rm -f -r /var/lib/pgsql/data
    su postgres
    initdb -D /var/lib/pgsql/data

Leave a Comment