ubuntu安装
# 安装依赖
apt install -y gcc make libreadline-gplv2-dev zlib1g-dev bison flex
# 创建用户
useradd -d /usr/local/pgsql/ -m -s /bin/bash postgres
# 编译安装
./configure --prefix=/usr/local/pgsql/
make
make install
centos安装
# 安装依赖
yum install -y git gcc make readline-devel zlib-devel bison flex
# 创建用户
useradd -d /usr/local/pgsql/ postgres
# 编译安装
./configure --prefix=/usr/local/pgsql/
make
make install