You install PostgreSQL on RHEL 5.

About this task

You must be logged in as root to perform the installation.

If database initialization fails, look for error messages in /var/lib/pgsql/9.1/pgstartup.log.

Procedure

  1. Run wget http://yum.postgresql.org/9.1/redhat/rhel-5-x86_64/pgdg-redhat91-9.1-5.noarch.rpm to download a 9.1 PostgreSQL RPM from the PostgreSQL yum repository.
  2. Run yum install pgdg-redhat91-9.1-5.noarch.rpm to install the RPM.
  3. Run yum install postgresql91-server postgresql91-contrib to install the PostgreSQL server and contrib modules.
  4. Run service postgresql-9.1 initdb to initialize PostgreSQL.

    The initdb command creates the directories to contain database information, generates shared catalog tables, and creates the template1 and postgres databases. New databases that you create are based on the template1 database. The postgres database is a default database for use by all users, utilities and third party applications.

What to do next

Define data and log locations. See Define Data and Log Locations.