# sudo yum install http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos92-9.5-3.noarch.rpm -y
2. Install postgresql-9.5 and dependency
# sudo yum install postgresql95 postgresql95-server postgresql95-contrib rsync repmgr95 -y
3. After install postgresql, Initializing pgdata
# sudo /usr/pgsql-9.5/bin/postgresql95-setup initdb
4. Open port firewall for postgresql
# sudo firewall-cmd --permanent --zone=public --add-service=postgresql
5. Reload firewall
# sudo systemctl reload firewalld
6. To start postgresql service using following command
# sudo systemctl start postgresql-9.5
7. Enable postgresql for auto start on system after server restart
# sudo systemctl enable postgresql-9.5
8. Check status postgresql with this commands
# sudo systemctl status postgresql-9.5
In my server I need install extension for develop my website. Among them postgrsql-plpython, an pgcrypto
9. Add repository with type command below
# yum install centos-release-scl-rh
10. Then install postgrsql-plython with command
# yum --enablerepo=centos-sclo-rh-testing install postgresql95-postgresql-plpython
# yum install postgresql-plpython
# CREATE EXTENSION plpythonu;
# UPDATE pg_language SET lanpltrusted = true WHERE lanname = 'plpythonu';
# GRANT ALL ON LANGUAGE plpythonu TO user;
11. Then install pgcrypto with this command
# CREATE EXTENSION pgcrypto;