Установка:
yum -y install https://download.postgresql.org/pub/repos/yum/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-3.noarch.rpm
yum -y install postgresql95 postgresql95-server postgresql95-contrib postgresql95-libs
Инициализация:
/usr/pgsql-9.5/bin/postgresql95-setup initdb
Настройка авторизации
vi /var/lib/pgsql/9.5/data/pg_hba.conf
Блок
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 ident
# IPv6 local connections:
host all all ::1/128 ident
Заменить на
# "local" is for Unix domain socket connections only
local all all md5
# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5