访问 https://yum.postgresql.org/rpmchart.php 进行下载rpm安装包
pg11 安装
这里我下载 postgresql11 centos7 来测试
https://yum.postgresql.org/12/redhat/rhel-7-x86_64/repoview/
点击组
每个都安装最新版本的rpm包,有些会有 -1 -2 分开~
https://yum.postgresql.org/11/redhat/rhel-7-x86_64/repoview/postgresql11.html
这里仅记录下载的包
postgresql11-11.7-1PGDG.rhel7.x86_64.rpm
postgresql11-contrib-11.7-1PGDG.rhel7.x86_64.rpm
postgresql11-libs-11.7-1PGDG.rhel7.x86_64.rpm
postgresql11-server-11.7-1PGDG.rhel7.x86_64.rpm
一些其他依赖包
http://mirror.centos.org/centos/7/os/x86_64/Packages/libicu-50.2-3.el7.x86_64.rpm
http://mirror.centos.org/centos/7/os/x86_64/Packages/libxslt-1.1.28-5.el7.x86_64.rpm
yum install postgresql11-libs-11.7-1PGDG.rhel7.x86_64.rpm
yum install libicu-50.2-3.el7.x86_64.rpm
yum install postgresql11-11.7-1PGDG.rhel7.x86_64.rpm
yum install libxslt-1.1.28-5.el7.x86_64.rpm
yum install postgresql11-contrib-11.7-1PGDG.rhel7.x86_64.rpm
yum install postgresql11-server-11.7-1PGDG.rhel7.x86_64.rpm
安装完成后,会有 postgresql-11
服务
初始化
/usr/pgsql-11/bin/postgresql-11-setup initdb
启动及配置开机自启
systemctl enable postgresql-11
systemctl start postgresql-11
Psql
需要切换postgres 用户进行使用
su - postgres
输入psql即可
bash-4.2$ psql
psql (11.7)
Type "help" for help.