$ sudo yum install /path/to/package.rpm
## 安装PostgreSQL
$ sudo yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
$ sudo yum install postgresql96
$ sudo yum install postgresql96-server
## 初始化,设置自动启动
$ sudo /usr/pgsql-9.6/bin/postgresql96-setup initdb
$ sudo systemctl enable postgresql-9.6
$ sudo systemctl start postgresql-9.6
## 切换postgres用户,启动postgres
$ sudo -i -u postgres
$ psql
## 创建数据库、用户和密码
CREATE USER kong; CREATE DATABASE kong OWNER kong; ALTER USER kong WITH password 'kong';
## 退出
$ psql> \q
$ exit
## 修改postgreSQL配置/var/lib/pgsql/9.6/data/pg_hba.conf
# Under IPv4 local connections replace ident with md5:
# Protocol Type Database User Address Method
# IPv4 local host all all 127.0.0.1/32 md5