If you have tried installing PostgreSQL database on CentOS 5.5 using yum, you will notice that you have 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
wget http://yum.pgrpms.org/reporpms/8.4/pgdg-centos-8.4-2.noarch.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
When service postgresql initdb:
If (“Data directory is not empty”)
{
(
rm -f -r /usr/local/pgsql/data
or
rm -f -r /var/lib/pgsql/data
)
su postgres
initdb -D /var/lib/pgsql/data
};
Your links are deprecated, they should now be based in http://yum.pgrpms.org/reporpms/
Thanks David, I have updated the URL in the article.