You install PostgreSQL on RHEL 5.

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.


Run wget to download a 9.1 PostgreSQL RPM from the PostgreSQL yum repository.


Run yum install pgdg-redhat91-9.1-5.noarch.rpm to install the RPM.


Run yum install postgresql91-server postgresql91-contrib to install the PostgreSQL server and contrib modules.


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.

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