This installation guide will show you how to install, configure and test PostreSQL on the CentOS operating system.
Install Default PostgreSQL version
Log in to your server as root
yum install postgresql postgresql-server service postgresql initdb chkconfig postgresql on service postgresql start
Use PostgreSQL Repository for updates
If you need to install a particular version of PostgreSQL here are the steps to downloading and installing. Log in to your server as root
yum install wget wget http://yum.postgresql.org/9.2/redhat/rhel-5-x86_64/pgdg-centos92-9.2-6.noarch.rpm rpm -ih pgdg-centos92-9.2-6.noarch.rpm yum install postgresql92 postgresql92-server service postgresql-9.2 initdb chkconfig postgresql-9.2 on service postgresql-9.2 start
Login and Test
Congratulations your PostgreSQL server is now installed and up and running. You can log in as follows
su - postgres psql -U postgres CREATE DATABASE testdb;