参考: https://www.postgresql.org/download/linux/redhat/
添加新源
yum install http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-redhat95-9.5-2.noarch.rpm
安装
yum install postgresql95-server postgresql95-contrib
初始化:
/usr/pgsql-9.5/bin/postgresql95-setup initdb
启动服务:
service postgresql-9.5 restart
也可以直接安装适合各个linux发行版的安装包:
http://www.bigsql.org/postgresql/installers.jsp