Esta es una instalación peculiar, en el que utilizaremos una versión reciente de CentOS y una versión antigua de PostgreSQL.
# yum update
# yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm
# yum install postgresql96 postgresql96-server postgresql96-contrib postgresql96-libs
# /usr/pgsql-9.6/bin/postgresql96-setup initdb
# systemctl enable postgresql-9.6.service
# systemctl start postgresql-9.6.service
# su – postgres
#bash. psql
#psql ALTER USER 'postgres' WITH PASSWORD 'contraseña';
#psql \q
#bash. exit
Luego editar los archivos postgresql.conf y pg_hba.conf
# nano /var/lib/pgsql/9.6/data/postgresql.conf
# nano /var/lib/pgsql/9.6/data/pg_hba.conf
# systemctl restart postgresql-9.6.service
Si nano no existe utilizar # yum install nano -y para su instalación
Agregar reglas para el Firewall
[root@localhost ~]# firewall-cmd --permanent --zone=trusted --add-source=127.0.0.1/32
success
[root@localhost ~]# firewall-cmd --permanent --zone=trusted --add-port=5432/tcp
success
[root@localhost ~]#