I installed RHEL6 and was pleased to see PostgreSQL v8.4.7 packaged with it. However, v9.0 has come out and I need to stay abreast of the latest developments and test my software applications against it. Therefore, I took the following steps to install v9.0.4.
STEP 1: Downloaded and installed the RPMS
I downloaded the pgdg-redhat-9.0.2.noarch.rpm from PgRPMs. I then installed the RPM using:
rpm -ivh pgdg-redhat-9.0-2.noarch.rpm
Following the completion of the install, I used yum to install the packages with:
yum install postgresql90.x86_64 postgresql90-server.x86_64 postgresql90-libs.x86_64 postgresql90-contrib.x86_64 postgresql90-devel.x86_64
After answering “y” when the dependencies were resolved, and yum finished, I checked to see what I had installed using:
yum list *posgres*
which returned:
Installed Packages
postgresql-libs.x86_64 8.4.4-2.el6 @anaconda-RedHatEnterpriseLinux-201009221801.x86_64/6.0
postgresql90.x86_64 9.0.4-1PGDG.rhel6 @pgdg90
postgresql90-contrib.x86_64 9.0.4-1PGDG.rhel6 @pgdg90
postgresql90-devel.x86_64 9.0.4-1PGDG.rhel6 @pgdg90
postgresql90-libs.x86_64 9.0.4-1PGDG.rhel6 @pgdg90
postgresql90-server.x86_64 9.0.4-1PGDG.rhel6 @pgdg90
STEP 2: Setup PostgreSQL
To complete the installation, I did the following:
service postgresql-9.0 initdb
service postgresql-9.0 start
chkconfig postgresql-9.0 on
vi /etc/profile
I then updated the profile to put the PostgreSQL 9.0 library in the LD_LIBRARY_PATH by:
vi /etc/profile
export LD_LIBRARY_PATH=/usr/pgsql-9.0/lib:$LD_LIBRARY_PATH
source /etc/profile
I then updated the pg_hba.conf file to allow trusted connections from my local area network using:
cd /var/lib/pgsql/9.0/data
vi pg_hba.conf
The edits are shown in the screenshot below:
STEP 3: Testing
I then switched to the postgres user and tested for connectivity using:
# su postgres
bash-4.1$ psql -U postgres
psql (9.0.4)
Type "help" for help.
postgres=#
I then rebooted the server and verified that postgres started correctly.
Did you install rhel6 version of postgres? I can only find rhel5 version of it even on the official repository. The directory with rhel6 is empty.
I downloaded pgdg-redhat-9.0-2.noarch.rpm from http://www.pgrpms.org/reporpms/repoview/pgdg-redhat.html and installed it. That doesn’t specify RHEL5 or RHEL6, which didn’t surprise me as almost none of the latest versions of RDBMS software were certified with RHEL6. I wanted to see how the performance was and whether it was usable, which it has been for my purposes.
Thanks for your answer Bill. I managed to find such location and there are versions for rhel6 – http://yum.pgrpms.org/packages.php.
Cool – I love pgrpms!