centOS7安装Postgresql11
1. 进入postgres官网,根据系统环境选择安装方式选择系统环境
2. 选择pg版本和系统环境
3. 安装
需在root用户权限下安装
yum install https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
yum install postgresql11
yum install postgresql11-server
初始化数据库,并使其自启动服务
/usr/pgsql-11/bin/postgresql-11-setup initdb
systemctl enable postgresql-11
systemct