CentOS7 自带的PostgreSQL Server版本是9.x系列, 实际上官方稳定版已经是14了.
一切不如意都是不愿意看官方文档.
第一步就是打开官方文档, 找到对应的发行版本的安装介绍页面, https://www.postgresql.org/download/linux/redhat/
如上图所示, 蓝色区域是支持的发行版本, 红色区域是根据实际情况选择后,会生成安装脚本.
本文的环境是CentOS7 ,需要安装14系列则有了以下安装步骤:
sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
sudo yum install -y postgresql14-server
sudo /usr/pgsql-14/bin/postgresql-14-setup initdb
sudo systemctl enable postgresql-14
sudo systemctl start postgresql-14
本文由 systemofdown 创作,采用 知识共享署名 3.0 中国大陆许可协议 进行许可。 可自由转载、引用,但需署名作者且注明文章出处。