1. 下载源码
https://ftp.postgresql.org/pub/source/v10.16/postgresql-10.16.tar.gz
2.创建用户
groupadd -r postgres
useradd -r -g postgres -c "Postgresql" postgres
3. 编译
# yum install libxml2 libxml2-devel libxml2-python libxslt libxslt-devel libxslt-python zlib zlib-devel python-devel readline readline-devel -y
[root@dev-ec-0 postgresql-10.16]# ./configure --prefix=/usr/local/postgres --with-python --with-libxml --with-libxslt --with-zlib --with-pgport=5432
[root@dev-ec-0 postgresql-10.16]# make -j8
[root@dev-ec-0 postgresql-10.16]# make install
4. 初始化数据库<