Version postgresql9.6,centos_7,
1. Install with Yum and install the RPM source.
Yum Install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-centos96-9.6-3.noarch.rpm
2. Yum Installation
Yum Install postgresql96
Yum Install Postgresql96-server
3. Install and start
Cd/usr/pgsql-9.6/bin
./Postgresql96-setup Initdb
Systemctl Start postgresql-9.6
4. Configure remote connection and modify default password
Su Postgres
Psql
Alter user postgres with password ' 123456 '; #Change the default password
cd/var/lib/pgsql/9.6/data/
Vim pg_hda.conf
Modify the following
# TYPE DATABASE USER cidr-address METHOD
Host all 0.0.0.0/0 MD5 #Allow any ip access
Vim postgresql.conf
Modify
Li sten_addresses = '*' #Listen all
(Pay attention to shutting down the firewall or opening port)
PostgreSQL 9.6 Installing and configuring remote connections