tar xf postgresql-17.7.tar.gz cd /root/postgresql-17.7 ./configure --prefix=/data/postgresql-17.7 --with-perl --with-python make -j$(nproc) make install
安装contrib目录下的工具
cd /root/postgresql-17.7/contrib make -j$(nproc) make install
# "local" is for Unix domain socket connections only local all all md5 # IPv4 local connections: host all all 127.0.0.1/32 md5 # IPv6 local connections: host all all ::1/128 md5 host all all 0.0.0.0/0 md5 # Allow replication connections from localhost, by a user withthe # replication privilege. local replication all trust host replication all 127.0.0.1/32 trust host replication all ::1/128 trust
重启服务
systemctl restart postgresql
测试登录
psql -h localhost -U postgres Password for user postgres: psql (17.4) Type "help" for help.