安装yum -y install postgresql*

postpresql数据库  
192.168.127.131
/etc/rc.d/init.d/postgresql
启动
/etc/rc.d/init.d/postgresql start
配置文件
vim /var/lib/pgsql/data/pg_hba.conf
让所有机器都能连接
host    all             all             *         md5
重启
/etc/rc.d/init.d/postgresql restart
连接pgsql
psql -U postgres -d postgres -h localhost

默认创建了用户  postgres
使用postgres登录数据库
sudo -u postgres psql

2.修改PostgreSQL登录密码:
    ALTER USER postgres WITH PASSWORD 'postgres';
    //postgres=#为PostgreSQL下的命令提示符
3.退出PostgreSQL psql客户端
    \q

listen_address='localhost'

提供一个参考地址: