- In centos there is repos very old version. so we go to lastest files postgresql
Copy the download location and curl the rpm into the server
Install the rpm
rpm -ivh pgdg*
Install the server, It will also install 2 other packages.
yum install postgresql96-server
su - postgres -c "/usr/pgsql-9.6/bin/initdb -D /var/lib/pgsql/data"
su - postgres -c "/usr/pgsql-9.6/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start"
On CentOS 6.2 You should be able to auto start your postgres server by using chkconfig. you should be able to see what the service name is with something like
chkconfig --list | grep post
which on a C6 system I have to hand shows
... postgresql 0:off 1:off 2:off 3:off 4:off 5:off 6:off
Your installation from the vendor repository would likely look like
... postgresql-9.6 0:off 1:off 2:off 3:off 4:off 5:off 6:off
(disabled at all run levels). To enable it using chkconfig
chkconfig postgresql-9.6 on chkconfig --list | grep post ... postgresql-9.6 0:off 1:off 2:on 3:on 4:on 5:on 6:off
(enabled at run levels 2-5 off otherwise)