1、确认操作系统的版本
2、操作系统是centos7 64位,安装对应的postgres孥恶膈茯ql yum源rpm -Uvh https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-centos94-9.4-3.noarch.rpm
3、yum update更新完成之后操作系统变成了最新版本的7.4
4、执行安装命令yum install postgresql94-server postgresql94-contrib
5、检查是否安装成功[root@client ~]# rpm -qa| grep postgrespostgresql94-libs-9.4.15-1PGDG.rhe造婷用痃l7.x86_64postgresql94-server-9.4.15-1PGDG.rhel7.x86_64postgresql94-9.4.15-1PGDG.rhel7.x86_64postgresql94-contrib-9.4.15-1PGDG.rhel7.x86_64
6、初始化数据库/usr/pgsql-9.4/bin/postgresql94-setup initdb
7、启动服务并设置为开机启动systemctl enable postgresql-9.4systemctl start postgresql-9.4
8、访问PostgreSQLsu - postgres输入命令psql将看到PostgrSQL的版本信息
9、设置postgres用户密码postgres=# \password postgresEnter new password:Enter it again:postgres=#