前言
本教程采用rpm安装方式,相比源码编译方式要简单很多,源码编译的依赖和环境问题太费劲了o(╥﹏╥)o,整理了一篇简单的安装教程给大家。
1 环境
系统环境:可以确定是centOS的x86_64位架构。
[root@VM-16-10-centos ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.9.2009 (Core)
Release: 7.9.2009
Codename: Core
2 基础环境安装
(1)安装redhat-lsb,可以查看对应的系统版本了,确定安装PostgreSQL版本。
yum install -y redhat-lsb
3 yum源的问题
关于安装PostgreSQL源的问题,官方提供的安装教程比较完善了,基本不需要过多的额外进行yum源的配置。
(1)下面链接是官方的安装教程,根据这个安装依赖,95%的依赖都已经包括了。
https://www.postgresql.org/download/linux/redhat/https://www.postgresql.org/download/linux/redhat/
(2)剩下的5%的依赖问题,通过yum install epel-release进行安装就可以了。EPEL到底是什么,为何经常要安装epel-release软件包-CSDN博客文章浏览阅读3.3w次,点赞26次,收藏59次。EPEL(Extra Packages for Enterprise Linux)是基于Fedora的一个项目,为“红帽系”的操作系统提供额外的软件包,适用于RHEL、CentOS和Scientific Linux.我们在Centos下使用yum安装时往往找不到rpm的情况,官方的rpm repository提供的rpm包也不够丰富,很多时候需要自己编译很痛苦,而EPEL恰恰可以解决这两方面的问题。EPEL的全称叫 Extra Packages for Enterprise Linux 。EPEL是由._epel-releasehttps://blog.csdn.net/weixin_41831919/article/details/109035936
4 安装PostgreSQL15.5
(1)参考官网安装教程,选择对应的系统信息,执行对应的安装语句。
PostgreSQL: Linux downloads (Red Hat family)
(2)执行源设置
(3)安装PostgreSQL
[root@VM-16-10-centos ~]# sudo yum install -y postgresql15-server
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package postgresql15-server.x86_64 0:15.5-1PGDG.rhel7 will be installed
--> Processing Dependency: postgresql15-libs(x86-64) = 15.5-1PGDG.rhel7 for package: postgresql15-server-15.5-1PGDG.rhel7.x86_64
--> Processing Dependency: postgresql15(x86-64) = 15.5-1PGDG.rhel7 for package: postgresql15-server-15.5-1PGDG.rhel7.x86_64
--> Processing Dependency: libzstd.so.1()(64bit) for package: postgresql15-server-15.5-1PGDG.rhel7.x86_64
--> Processing Dependency: libpq.so.5()(64bit) for package: postgresql15-server-15.5-1PGDG.rhel7.x86_64
--> Running transaction check
---> Package libzstd.x86_64 0:1.5.5-1.el7 will be installed
---> Package postgresql15.x86_64 0:15.5-1PGDG.rhel7 will be installed
---> Package postgresql15-libs.x86_64 0:15.5-1PGDG.rhel7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================
Package Arch Version Repository Size
=========================================================================================================
Installing:
postgresql15-server x86_64 15.5-1PGDG.rhel7 pgdg15 5.8 M
Installing for dependencies:
libzstd x86_64 1.5.5-1.el7 epel 292 k
postgresql15 x86_64 15.5-1PGDG.rhel7 pgdg15 1.6 M
postgresql15-libs x86_64 15.5-1PGDG.rhel7 pgdg15 284 k
Transaction Summary
=========================================================================================================
Install 1 Package (+3 Dependent packages)
Total download size: 8.0 M
Installed size: 34 M
Downloading packages:
(1/4): libzstd-1.5.5-1.el7.x86_64.rpm | 292 kB 00:00:00
warning: /var/cache/yum/x86_64/7/pgdg15/packages/postgresql15-libs-15.5-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY
Public key for postgresql15-libs-15.5-1PGDG.rhel7.x86_64.rpm is not installed
(2/4): postgresql15-libs-15.5-1PGDG.rhel7.x86_64.rpm | 284 kB 00:00:02
(3/4): postgresql15-15.5-1PGDG.rhel7.x86_64.rpm | 1.6 MB 00:00:03
(4/4): postgresql15-server-15.5-1PGDG.rhel7.x86_64.rpm | 5.8 MB 00:00:02
---------------------------------------------------------------------------------------------------------
Total 1.6 MB/s | 8.0 MB 00:00:04
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Importing GPG key 0x442DF0F8:
Userid : "PostgreSQL RPM Building Project <pgsql-pkg-yum@postgresql.org>"
Fingerprint: 68c9 e2b9 1a37 d136 fe74 d176 1f16 d2e1 442d f0f8
Package : pgdg-redhat-repo-42.0-35PGDG.noarch (@/pgdg-redhat-repo-latest.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : postgresql15-libs-15.5-1PGDG.rhel7.x86_64 1/4
Installing : libzstd-1.5.5-1.el7.x86_64 2/4
Installing : postgresql15-15.5-1PGDG.rhel7.x86_64 3/4
Installing : postgresql15-server-15.5-1PGDG.rhel7.x86_64 4/4
Verifying : postgresql15-15.5-1PGDG.rhel7.x86_64 1/4
Verifying : libzstd-1.5.5-1.el7.x86_64 2/4
Verifying : postgresql15-server-15.5-1PGDG.rhel7.x86_64 3/4
Verifying : postgresql15-libs-15.5-1PGDG.rhel7.x86_64 4/4
Installed:
postgresql15-server.x86_64 0:15.5-1PGDG.rhel7
Dependency Installed:
libzstd.x86_64 0:1.5.5-1.el7 postgresql15.x86_64 0:15.5-1PGDG.rhel7
postgresql15-libs.x86_64 0:15.5-1PGDG.rhel7
Complete!
(3)初始化数据库
[root@VM-16-10-centos ~]# sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
Initializing database ... OK
[root@VM-16-10-centos ~]# sudo systemctl enable postgresql-15
Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql-15.service to /usr/lib/systemd/system/postgresql-15.service.
[root@VM-16-10-centos ~]# sudo systemctl start postgresql-15
[root@VM-16-10-centos ~]#
5 安装PostGIS 3.3
(1)确定安装版本yum search postgis,根据postgreSQL 版本,确定安装postgis33_15.x86_64版本。
[root@VM-16-10-centos ~]# yum search postgis
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
========================================= N/S matched: postgis ==========================================
postgis-docs.x86_64 : Extra documentation for PostGIS
postgis-utils.x86_64 : The utils for PostGIS
postgis24_11-client.x86_64 : Client tools and their libraries of PostGIS
postgis24_11-devel.x86_64 : Development headers and libraries for PostGIS
postgis24_11-docs.x86_64 : Extra documentation for PostGIS
postgis24_11-gui.x86_64 : GUI for PostGIS
postgis24_11-utils.x86_64 : The utils for PostGIS
postgis25_11-client.x86_64 : Client tools and their libraries of PostGIS
postgis25_11-devel.x86_64 : Development headers and libraries for PostGIS
postgis25_11-docs.x86_64 : Extra documentation for PostGIS
postgis25_11-gui.x86_64 : GUI for PostGIS
postgis25_11-utils.x86_64 : The utils for PostGIS
postgis25_12-client.x86_64 : Client tools and their libraries of PostGIS
postgis25_12-devel.x86_64 : Development headers and libraries for PostGIS
postgis25_12-docs.x86_64 : Extra documentation for PostGIS
postgis25_12-gui.x86_64 : GUI for PostGIS
postgis25_12-utils.x86_64 : The utils for PostGIS
postgis30_11-client.x86_64 : Client tools and their libraries of PostGIS
postgis30_11-devel.x86_64 : Development headers and libraries for PostGIS
postgis30_11-docs.x86_64 : Extra documentation for PostGIS
postgis30_11-gui.x86_64 : GUI for PostGIS
postgis30_11-utils.x86_64 : The utils for PostGIS
postgis30_12-client.x86_64 : Client tools and their libraries of PostGIS
postgis30_12-devel.x86_64 : Development headers and libraries for PostGIS
postgis30_12-docs.x86_64 : Extra documentation for PostGIS
postgis30_12-gui.x86_64 : GUI for PostGIS
postgis30_12-utils.x86_64 : The utils for PostGIS
postgis30_13-client.x86_64 : Client tools and their libraries of PostGIS
postgis30_13-devel.x86_64 : Development headers and libraries for PostGIS
postgis30_13-docs.x86_64 : Extra documentation for PostGIS
postgis30_13-gui.x86_64 : GUI for PostGIS
postgis30_13-utils.x86_64 : The utils for PostGIS
postgis31_11-client.x86_64 : Client tools and their libraries of PostGIS
postgis31_11-devel.x86_64 : Development headers and libraries for PostGIS
postgis31_11-docs.x86_64 : Extra documentation for PostGIS
postgis31_11-gui.x86_64 : GUI for PostGIS
postgis31_11-llvmjit.x86_64 : Just-in-time compilation support for postgis31
postgis31_11-utils.x86_64 : The utils for PostGIS
postgis31_12-client.x86_64 : Client tools and their libraries of PostGIS
postgis31_12-devel.x86_64 : Development headers and libraries for PostGIS
postgis31_12-docs.x86_64 : Extra documentation for PostGIS
postgis31_12-gui.x86_64 : GUI for PostGIS
postgis31_12-llvmjit.x86_64 : Just-in-time compilation support for postgis31
postgis31_12-utils.x86_64 : The utils for PostGIS
postgis31_13-client.x86_64 : Client tools and their libraries of PostGIS
postgis31_13-devel.x86_64 : Development headers and libraries for PostGIS
postgis31_13-docs.x86_64 : Extra documentation for PostGIS
postgis31_13-gui.x86_64 : GUI for PostGIS
postgis31_13-llvmjit.x86_64 : Just-in-time compilation support for postgis31
postgis31_13-utils.x86_64 : The utils for PostGIS
postgis31_14-client.x86_64 : Client tools and their libraries of PostGIS
postgis31_14-devel.x86_64 : Development headers and libraries for PostGIS
postgis31_14-docs.x86_64 : Extra documentation for PostGIS
postgis31_14-gui.x86_64 : GUI for PostGIS
postgis31_14-llvmjit.x86_64 : Just-in-time compilation support for postgis31
postgis31_14-utils.x86_64 : The utils for PostGIS
postgis32_11-client.x86_64 : Client tools and their libraries of PostGIS
postgis32_11-devel.x86_64 : Development headers and libraries for PostGIS
postgis32_11-docs.x86_64 : Extra documentation for PostGIS
postgis32_11-gui.x86_64 : GUI for PostGIS
postgis32_11-llvmjit.x86_64 : Just-in-time compilation support for postgis32
postgis32_11-utils.x86_64 : The utils for PostGIS
postgis32_12-client.x86_64 : Client tools and their libraries of PostGIS
postgis32_12-devel.x86_64 : Development headers and libraries for PostGIS
postgis32_12-docs.x86_64 : Extra documentation for PostGIS
postgis32_12-gui.x86_64 : GUI for PostGIS
postgis32_12-llvmjit.x86_64 : Just-in-time compilation support for postgis32
postgis32_12-utils.x86_64 : The utils for PostGIS
postgis32_13-client.x86_64 : Client tools and their libraries of PostGIS
postgis32_13-devel.x86_64 : Development headers and libraries for PostGIS
postgis32_13-docs.x86_64 : Extra documentation for PostGIS
postgis32_13-gui.x86_64 : GUI for PostGIS
postgis32_13-llvmjit.x86_64 : Just-in-time compilation support for postgis32
postgis32_13-utils.x86_64 : The utils for PostGIS
postgis32_14-client.x86_64 : Client tools and their libraries of PostGIS
postgis32_14-devel.x86_64 : Development headers and libraries for PostGIS
postgis32_14-docs.x86_64 : Extra documentation for PostGIS
postgis32_14-gui.x86_64 : GUI for PostGIS
postgis32_14-llvmjit.x86_64 : Just-in-time compilation support for postgis32
postgis32_14-utils.x86_64 : The utils for PostGIS
postgis32_15-client.x86_64 : Client tools and their libraries of PostGIS
postgis32_15-devel.x86_64 : Development headers and libraries for PostGIS
postgis32_15-docs.x86_64 : Extra documentation for PostGIS
postgis32_15-gui.x86_64 : GUI for PostGIS
postgis32_15-llvmjit.x86_64 : Just-in-time compilation support for postgis32
postgis32_15-utils.x86_64 : The utils for PostGIS
postgis33_11-client.x86_64 : Client tools and their libraries of PostGIS
postgis33_11-devel.x86_64 : Development headers and libraries for PostGIS
postgis33_11-docs.x86_64 : Extra documentation for PostGIS
postgis33_11-gui.x86_64 : GUI for PostGIS
postgis33_11-llvmjit.x86_64 : Just-in-time compilation support for postgis33
postgis33_11-utils.x86_64 : The utils for PostGIS
postgis33_12-client.x86_64 : Client tools and their libraries of PostGIS
postgis33_12-devel.x86_64 : Development headers and libraries for PostGIS
postgis33_12-docs.x86_64 : Extra documentation for PostGIS
postgis33_12-gui.x86_64 : GUI for PostGIS
postgis33_12-llvmjit.x86_64 : Just-in-time compilation support for postgis33
postgis33_12-utils.x86_64 : The utils for PostGIS
postgis33_13-client.x86_64 : Client tools and their libraries of PostGIS
postgis33_13-devel.x86_64 : Development headers and libraries for PostGIS
postgis33_13-docs.x86_64 : Extra documentation for PostGIS
postgis33_13-gui.x86_64 : GUI for PostGIS
postgis33_13-llvmjit.x86_64 : Just-in-time compilation support for postgis33
postgis33_13-utils.x86_64 : The utils for PostGIS
postgis33_14-client.x86_64 : Client tools and their libraries of PostGIS
postgis33_14-devel.x86_64 : Development headers and libraries for PostGIS
postgis33_14-docs.x86_64 : Extra documentation for PostGIS
postgis33_14-gui.x86_64 : GUI for PostGIS
postgis33_14-llvmjit.x86_64 : Just-in-time compilation support for postgis33
postgis33_14-utils.x86_64 : The utils for PostGIS
postgis33_15-client.x86_64 : Client tools and their libraries of PostGIS
postgis33_15-devel.x86_64 : Development headers and libraries for PostGIS
postgis33_15-docs.x86_64 : Extra documentation for PostGIS
postgis33_15-gui.x86_64 : GUI for PostGIS
postgis33_15-llvmjit.x86_64 : Just-in-time compilation support for postgis33
postgis33_15-utils.x86_64 : The utils for PostGIS
SFCGAL.x86_64 : C++ wrapper library around CGAL for PostGIS
pgrouting_11.x86_64 : Routing functionality for PostGIS
pgrouting_12.x86_64 : Routing functionality for PostGIS
pgrouting_13.x86_64 : Routing functionality for PostGIS
pgrouting_14.x86_64 : Routing functionality for PostGIS
pgrouting_15.x86_64 : Routing functionality for PostGIS
postgis.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis24_11.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis25_11.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis25_12.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis30_11.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis30_12.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis30_13.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis31_11.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis31_12.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis31_13.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis31_14.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis32_11.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis32_12.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis32_13.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis32_14.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis32_15.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis33_11.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis33_12.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis33_13.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis33_14.x86_64 : Geographic Information Systems Extensions to PostgreSQL
postgis33_15.x86_64 : Geographic Information Systems Extensions to PostgreSQL
Name and summary matches only, use "search all" for everything.
[root@VM-16-10-centos ~]#
(2)PostGIS安装 yum install postgis33_15.x86_64
[root@VM-16-10-centos ~]# yum install postgis33_15.x86_64
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package postgis33_15.x86_64 0:3.3.3-1.rhel7 will be installed
--> Processing Dependency: proj72 >= 7.2.1 for package: postgis33_15-3.3.3-1.rhel7.x86_64
--> Processing Dependency: geos311 >= 3.11.2 for package: postgis33_15-3.3.3-1.rhel7.x86_64
--> Processing Dependency: gdal34-libs >= 3.4.3 for package: postgis33_15-3.3.3-1.rhel7.x86_64
--> Processing Dependency: xerces-c for package: postgis33_15-3.3.3-1.rhel7.x86_64
--> Processing Dependency: postgresql15-contrib for package: postgis33_15-3.3.3-1.rhel7.x86_64
--> Processing Dependency: libgeotiff16 for package: postgis33_15-3.3.3-1.rhel7.x86_64
--> Processing Dependency: hdf5 for package: postgis33_15-3.3.3-1.rhel7.x86_64
--> Processing Dependency: SFCGAL for package: postgis33_15-3.3.3-1.rhel7.x86_64
--> Processing Dependency: libproj.so.19()(64bit) for package: postgis33_15-3.3.3-1.rhel7.x86_64
--> Processing Dependency: libpcre2-8.so.0()(64bit) for package: postgis33_15-3.3.3-1.rhel7.x86_64
--> Processing Dependency: libgeos_c.so.1()(64bit) for package: postgis33_15-3.3.3-1.rhel7.x86_64
--> Processing Dependency: libgdal.so.30()(64bit) for package: postgis33_15-3.3.3-1.rhel7.x86_64
--> Processing Dependency: libSFCGAL.so.1()(64bit) for package: postgis33_15-3.3.3-1.rhel7.x86_64
--> Running transaction check
---> Package SFCGAL.x86_64 0:1.3.1-2.rhel7 will be installed
--> Processing Dependency: CGAL for package: SFCGAL-1.3.1-2.rhel7.x86_64
---> Package SFCGAL-libs.x86_64 0:1.3.1-2.rhel7 will be installed
--> Processing Dependency: libboost_serialization-mt.so.1.53.0()(64bit) for package: SFCGAL-libs-1.3.1-2.rhel7.x86_64
---> Package gdal34-libs.x86_64 0:3.4.3-4.rhel7 will be installed
--> Processing Dependency: ogdi41 for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: netcdf for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libspatialite43-devel for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libgeotiff16-devel for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: gpsbabel for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: geos310 for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: armadillo for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libspatialite.so.7()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libpoppler.so.46()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libogdi.so.4()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libodbcinst.so.2()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libodbc.so.2()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libnetcdf.so.7()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libgta.so.0()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libgif.so.4()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libfreexl.so.1()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libdapserver.so.7()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libdapclient.so.6()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libdap.so.17()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libcfitsio.so.2()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
--> Processing Dependency: libCharLS.so.1()(64bit) for package: gdal34-libs-3.4.3-4.rhel7.x86_64
---> Package geos311.x86_64 0:3.11.2-1.rhel7 will be installed
---> Package hdf5.x86_64 0:1.8.12-13.el7 will be installed
--> Processing Dependency: libsz.so.2()(64bit) for package: hdf5-1.8.12-13.el7.x86_64
---> Package libgeotiff16.x86_64 0:1.6.0-6.rhel7 will be installed
---> Package pcre2.x86_64 0:10.23-2.el7 will be installed
---> Package postgresql15-contrib.x86_64 0:15.5-1PGDG.rhel7 will be installed
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: postgresql15-contrib-15.5-1PGDG.rhel7.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: postgresql15-contrib-15.5-1PGDG.rhel7.x86_64
--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: postgresql15-contrib-15.5-1PGDG.rhel7.x86_64
--> Processing Dependency: libxslt.so.1()(64bit) for package: postgresql15-contrib-15.5-1PGDG.rhel7.x86_64
---> Package proj72.x86_64 0:7.2.1-1.rhel7 will be installed
--> Processing Dependency: sqlite33 for package: proj72-7.2.1-1.rhel7.x86_64
---> Package xerces-c.x86_64 0:3.1.1-10.el7_7 will be installed
--> Running transaction check
---> Package CGAL.x86_64 0:4.7-1.rhel7.1 will be installed
---> Package CharLS.x86_64 0:1.0-5.el7 will be installed
---> Package armadillo.x86_64 0:10.8.2-1.el7 will be installed
--> Processing Dependency: libarpack.so.2()(64bit) for package: armadillo-10.8.2-1.el7.x86_64
--> Processing Dependency: liblapack.so.3()(64bit) for package: armadillo-10.8.2-1.el7.x86_64
--> Processing Dependency: libopenblaso.so.0()(64bit) for package: armadillo-10.8.2-1.el7.x86_64
--> Processing Dependency: libsuperlu.so.5.1()(64bit) for package: armadillo-10.8.2-1.el7.x86_64
---> Package boost-serialization.x86_64 0:1.53.0-28.el7 will be installed
---> Package cfitsio.x86_64 0:3.370-10.el7 will be installed
---> Package freexl.x86_64 0:1.0.6-3.el7 will be installed
---> Package geos310.x86_64 0:3.10.3-1.rhel7 will be installed
---> Package giflib.x86_64 0:4.1.6-9.el7 will be installed
---> Package gpsbabel.x86_64 0:1.5.0-2.el7 will be installed
--> Processing Dependency: libshp.so.1()(64bit) for package: gpsbabel-1.5.0-2.el7.x86_64
--> Processing Dependency: libusb-0.1.so.4()(64bit) for package: gpsbabel-1.5.0-2.el7.x86_64
---> Package libaec.x86_64 0:1.0.4-1.el7 will be installed
---> Package libdap.x86_64 0:3.13.1-2.el7 will be installed
---> Package libgeotiff16-devel.x86_64 0:1.6.0-6.rhel7 will be installed
--> Processing Dependency: libtiff-devel for package: libgeotiff16-devel-1.6.0-6.rhel7.x86_64
---> Package libgta.x86_64 0:1.0.4-1.el7 will be installed
---> Package libspatialite43.x86_64 0:4.3.0a-15.rhel7 will be installed
--> Processing Dependency: geos39 >= 3.9.0 for package: libspatialite43-4.3.0a-15.rhel7.x86_64
---> Package libspatialite43-devel.x86_64 0:4.3.0a-15.rhel7 will be installed
---> Package libxslt.x86_64 0:1.1.28-6.el7 will be installed
---> Package netcdf.x86_64 0:4.3.3.1-5.el7 will be installed
---> Package ogdi41.x86_64 0:4.1.0-2.rhel7 will be installed
---> Package poppler.x86_64 0:0.26.5-43.el7.1 will be installed
--> Processing Dependency: poppler-data >= 0.4.0 for package: poppler-0.26.5-43.el7.1.x86_64
--> Processing Dependency: libopenjpeg.so.1()(64bit) for package: poppler-0.26.5-43.el7.1.x86_64
---> Package sqlite33.x86_64 0:3.30.1-6.rhel7 will be installed
--> Processing Dependency: sqlite33-libs = 3.30.1-6.rhel7 for package: sqlite33-3.30.1-6.rhel7.x86_64
---> Package unixODBC.x86_64 0:2.3.1-14.el7 will be installed
--> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-2.3.1-14.el7.x86_64
--> Running transaction check
---> Package SuperLU.x86_64 0:5.2.0-5.el7 will be installed
--> Processing Dependency: libsatlas.so.3()(64bit) for package: SuperLU-5.2.0-5.el7.x86_64
---> Package arpack.x86_64 0:3.1.3-2.el7 will be installed
---> Package geos39.x86_64 0:3.9.2-1.rhel7 will be installed
---> Package lapack.x86_64 0:3.4.2-8.el7 will be installed
--> Processing Dependency: libblas.so.3()(64bit) for package: lapack-3.4.2-8.el7.x86_64
---> Package libtiff-devel.x86_64 0:4.0.3-35.el7 will be installed
---> Package libtool-ltdl.x86_64 0:2.4.2-22.el7_3 will be installed
---> Package libusb.x86_64 1:0.1.4-3.el7 will be installed
---> Package openblas-openmp.x86_64 0:0.3.3-2.el7 will be installed
---> Package openjpeg-libs.x86_64 0:1.5.1-18.el7 will be installed
---> Package poppler-data.noarch 0:0.4.6-3.el7 will be installed
---> Package shapelib.x86_64 0:1.3.0-3.el7 will be installed
---> Package sqlite33-libs.x86_64 0:3.30.1-6.rhel7 will be installed
--> Running transaction check
---> Package atlas.x86_64 0:3.10.1-12.el7 will be installed
---> Package blas.x86_64 0:3.4.2-8.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================================================
Package Arch Version Repository Size
=========================================================================================================
Installing:
postgis33_15 x86_64 3.3.3-1.rhel7 pgdg15 4.8 M
Installing for dependencies:
CGAL x86_64 4.7-1.rhel7.1 pgdg-common 254 k
CharLS x86_64 1.0-5.el7 epel 63 k
SFCGAL x86_64 1.3.1-2.rhel7 pgdg-common 14 k
SFCGAL-libs x86_64 1.3.1-2.rhel7 pgdg-common 1.7 M
SuperLU x86_64 5.2.0-5.el7 epel 180 k
armadillo x86_64 10.8.2-1.el7 epel 36 k
arpack x86_64 3.1.3-2.el7 epel 101 k
atlas x86_64 3.10.1-12.el7 os 4.5 M
blas x86_64 3.4.2-8.el7 os 399 k
boost-serialization x86_64 1.53.0-28.el7 os 169 k
cfitsio x86_64 3.370-10.el7 epel 528 k
freexl x86_64 1.0.6-3.el7 epel 32 k
gdal34-libs x86_64 3.4.3-4.rhel7 pgdg-common 8.1 M
geos310 x86_64 3.10.3-1.rhel7 pgdg-common 863 k
geos311 x86_64 3.11.2-1.rhel7 pgdg-common 897 k
geos39 x86_64 3.9.2-1.rhel7 pgdg-common 646 k
giflib x86_64 4.1.6-9.el7 os 40 k
gpsbabel x86_64 1.5.0-2.el7 epel 794 k
hdf5 x86_64 1.8.12-13.el7 epel 1.6 M
lapack x86_64 3.4.2-8.el7 os 5.4 M
libaec x86_64 1.0.4-1.el7 epel 34 k
libdap x86_64 3.13.1-2.el7 epel 423 k
libgeotiff16 x86_64 1.6.0-6.rhel7 pgdg-common 94 k
libgeotiff16-devel x86_64 1.6.0-6.rhel7 pgdg-common 29 k
libgta x86_64 1.0.4-1.el7 epel 32 k
libspatialite43 x86_64 4.3.0a-15.rhel7 pgdg-common 2.4 M
libspatialite43-devel x86_64 4.3.0a-15.rhel7 pgdg-common 73 k
libtiff-devel x86_64 4.0.3-35.el7 os 474 k
libtool-ltdl x86_64 2.4.2-22.el7_3 os 49 k
libusb x86_64 1:0.1.4-3.el7 os 19 k
libxslt x86_64 1.1.28-6.el7 os 242 k
netcdf x86_64 4.3.3.1-5.el7 epel 693 k
ogdi41 x86_64 4.1.0-2.rhel7 pgdg-common 218 k
openblas-openmp x86_64 0.3.3-2.el7 epel 4.4 M
openjpeg-libs x86_64 1.5.1-18.el7 os 86 k
pcre2 x86_64 10.23-2.el7 os 201 k
poppler x86_64 0.26.5-43.el7.1 updates 787 k
poppler-data noarch 0.4.6-3.el7 os 2.2 M
postgresql15-contrib x86_64 15.5-1PGDG.rhel7 pgdg15 711 k
proj72 x86_64 7.2.1-1.rhel7 pgdg-common 2.5 M
shapelib x86_64 1.3.0-3.el7 epel 64 k
sqlite33 x86_64 3.30.1-6.rhel7 pgdg-common 624 k
sqlite33-libs x86_64 3.30.1-6.rhel7 pgdg-common 550 k
unixODBC x86_64 2.3.1-14.el7 os 413 k
xerces-c x86_64 3.1.1-10.el7_7 os 879 k
Transaction Summary
=========================================================================================================
Install 1 Package (+45 Dependent packages)
Total download size: 49 M
Installed size: 227 M
Is this ok [y/d/N]: y
Downloading packages:
(1/46): CharLS-1.0-5.el7.x86_64.rpm | 63 kB 00:00:00
(2/46): SFCGAL-1.3.1-2.rhel7.x86_64.rpm | 14 kB 00:00:01
(3/46): armadillo-10.8.2-1.el7.x86_64.rpm | 36 kB 00:00:00
(4/46): SuperLU-5.2.0-5.el7.x86_64.rpm | 180 kB 00:00:00
(5/46): arpack-3.1.3-2.el7.x86_64.rpm | 101 kB 00:00:00
(6/46): blas-3.4.2-8.el7.x86_64.rpm | 399 kB 00:00:00
(7/46): CGAL-4.7-1.rhel7.1.x86_64.rpm | 254 kB 00:00:02
(8/46): boost-serialization-1.53.0-28.el7.x86_64.rpm | 169 kB 00:00:00
(9/46): cfitsio-3.370-10.el7.x86_64.rpm | 528 kB 00:00:00
(10/46): freexl-1.0.6-3.el7.x86_64.rpm | 32 kB 00:00:00
(11/46): atlas-3.10.1-12.el7.x86_64.rpm | 4.5 MB 00:00:01
(12/46): gdal34-libs-3.4.3-4.rhel7.x86_64.rpm | 8.1 MB 00:00:01
(13/46): geos310-3.10.3-1.rhel7.x86_64.rpm | 863 kB 00:00:00
(14/46): geos311-3.11.2-1.rhel7.x86_64.rpm | 897 kB 00:00:00
(15/46): giflib-4.1.6-9.el7.x86_64.rpm | 40 kB 00:00:00
(16/46): geos39-3.9.2-1.rhel7.x86_64.rpm | 646 kB 00:00:00
(17/46): hdf5-1.8.12-13.el7.x86_64.rpm | 1.6 MB 00:00:00
(18/46): libaec-1.0.4-1.el7.x86_64.rpm | 34 kB 00:00:00
(19/46): libdap-3.13.1-2.el7.x86_64.rpm | 423 kB 00:00:00
(20/46): libgeotiff16-1.6.0-6.rhel7.x86_64.rpm | 94 kB 00:00:00
(21/46): gpsbabel-1.5.0-2.el7.x86_64.rpm | 794 kB 00:00:00
(22/46): libgta-1.0.4-1.el7.x86_64.rpm | 32 kB 00:00:00
(23/46): libgeotiff16-devel-1.6.0-6.rhel7.x86_64.rpm | 29 kB 00:00:00
(24/46): libspatialite43-4.3.0a-15.rhel7.x86_64.rpm | 2.4 MB 00:00:00
(25/46): libspatialite43-devel-4.3.0a-15.rhel7.x86_64.rpm | 73 kB 00:00:00
(26/46): libtiff-devel-4.0.3-35.el7.x86_64.rpm | 474 kB 00:00:00
(27/46): libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm | 49 kB 00:00:00
(28/46): libusb-0.1.4-3.el7.x86_64.rpm | 19 kB 00:00:00
(29/46): ogdi41-4.1.0-2.rhel7.x86_64.rpm | 218 kB 00:00:00
(30/46): netcdf-4.3.3.1-5.el7.x86_64.rpm | 693 kB 00:00:00
(31/46): libxslt-1.1.28-6.el7.x86_64.rpm | 242 kB 00:00:00
(32/46): openjpeg-libs-1.5.1-18.el7.x86_64.rpm | 86 kB 00:00:00
(33/46): pcre2-10.23-2.el7.x86_64.rpm | 201 kB 00:00:00
(34/46): poppler-0.26.5-43.el7.1.x86_64.rpm | 787 kB 00:00:00
(35/46): openblas-openmp-0.3.3-2.el7.x86_64.rpm | 4.4 MB 00:00:00
(36/46): poppler-data-0.4.6-3.el7.noarch.rpm | 2.2 MB 00:00:00
(37/46): lapack-3.4.2-8.el7.x86_64.rpm | 5.4 MB 00:00:03
(38/46): shapelib-1.3.0-3.el7.x86_64.rpm | 64 kB 00:00:00
(39/46): postgis33_15-3.3.3-1.rhel7.x86_64.rpm | 4.8 MB 00:00:00
(40/46): proj72-7.2.1-1.rhel7.x86_64.rpm | 2.5 MB 00:00:02
(41/46): sqlite33-3.30.1-6.rhel7.x86_64.rpm | 624 kB 00:00:00
(42/46): sqlite33-libs-3.30.1-6.rhel7.x86_64.rpm | 550 kB 00:00:00
(43/46): unixODBC-2.3.1-14.el7.x86_64.rpm | 413 kB 00:00:00
(44/46): xerces-c-3.1.1-10.el7_7.x86_64.rpm | 879 kB 00:00:00
(45/46): SFCGAL-libs-1.3.1-2.rhel7.x86_64.rpm | 1.7 MB 00:00:11
(46/46): postgresql15-contrib-15.5-1PGDG.rhel7.x86_64.rpm | 711 kB 00:00:23
---------------------------------------------------------------------------------------------------------
Total 1.6 MB/s | 49 MB 00:00:31
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : geos311-3.11.2-1.rhel7.x86_64 1/46
Installing : sqlite33-libs-3.30.1-6.rhel7.x86_64 2/46
Installing : pcre2-10.23-2.el7.x86_64 3/46
Installing : CGAL-4.7-1.rhel7.1.x86_64 4/46
Installing : xerces-c-3.1.1-10.el7_7.x86_64 5/46
Installing : atlas-3.10.1-12.el7.x86_64 6/46
Installing : freexl-1.0.6-3.el7.x86_64 7/46
Installing : SuperLU-5.2.0-5.el7.x86_64 8/46
Installing : arpack-3.1.3-2.el7.x86_64 9/46
Installing : sqlite33-3.30.1-6.rhel7.x86_64 10/46
Installing : proj72-7.2.1-1.rhel7.x86_64 11/46
Installing : libgeotiff16-1.6.0-6.rhel7.x86_64 12/46
Installing : geos39-3.9.2-1.rhel7.x86_64 13/46
Installing : libspatialite43-4.3.0a-15.rhel7.x86_64 14/46
Installing : libspatialite43-devel-4.3.0a-15.rhel7.x86_64 15/46
Installing : geos310-3.10.3-1.rhel7.x86_64 16/46
Installing : libdap-3.13.1-2.el7.x86_64 17/46
Installing : libtiff-devel-4.0.3-35.el7.x86_64 18/46
Installing : libgeotiff16-devel-1.6.0-6.rhel7.x86_64 19/46
Installing : libaec-1.0.4-1.el7.x86_64 20/46
Installing : hdf5-1.8.12-13.el7.x86_64 21/46
Installing : netcdf-4.3.3.1-5.el7.x86_64 22/46
Installing : cfitsio-3.370-10.el7.x86_64 23/46
Installing : poppler-data-0.4.6-3.el7.noarch 24/46
Installing : 1:libusb-0.1.4-3.el7.x86_64 25/46
Installing : CharLS-1.0-5.el7.x86_64 26/46
Installing : ogdi41-4.1.0-2.rhel7.x86_64 27/46
Installing : libtool-ltdl-2.4.2-22.el7_3.x86_64 28/46
Installing : unixODBC-2.3.1-14.el7.x86_64 29/46
Installing : openjpeg-libs-1.5.1-18.el7.x86_64 30/46
Installing : poppler-0.26.5-43.el7.1.x86_64 31/46
Installing : boost-serialization-1.53.0-28.el7.x86_64 32/46
Installing : SFCGAL-libs-1.3.1-2.rhel7.x86_64 33/46
Installing : SFCGAL-1.3.1-2.rhel7.x86_64 34/46
Installing : shapelib-1.3.0-3.el7.x86_64 35/46
Installing : gpsbabel-1.5.0-2.el7.x86_64 36/46
Installing : blas-3.4.2-8.el7.x86_64 37/46
Installing : lapack-3.4.2-8.el7.x86_64 38/46
Installing : giflib-4.1.6-9.el7.x86_64 39/46
Installing : libgta-1.0.4-1.el7.x86_64 40/46
Installing : libxslt-1.1.28-6.el7.x86_64 41/46
Installing : postgresql15-contrib-15.5-1PGDG.rhel7.x86_64 42/46
Installing : openblas-openmp-0.3.3-2.el7.x86_64 43/46
Installing : armadillo-10.8.2-1.el7.x86_64 44/46
Installing : gdal34-libs-3.4.3-4.rhel7.x86_64 45/46
Installing : postgis33_15-3.3.3-1.rhel7.x86_64 46/46
Verifying : openblas-openmp-0.3.3-2.el7.x86_64 1/46
Verifying : libxslt-1.1.28-6.el7.x86_64 2/46
Verifying : freexl-1.0.6-3.el7.x86_64 3/46
Verifying : geos311-3.11.2-1.rhel7.x86_64 4/46
Verifying : SFCGAL-libs-1.3.1-2.rhel7.x86_64 5/46
Verifying : libspatialite43-4.3.0a-15.rhel7.x86_64 6/46
Verifying : libgta-1.0.4-1.el7.x86_64 7/46
Verifying : unixODBC-2.3.1-14.el7.x86_64 8/46
Verifying : postgis33_15-3.3.3-1.rhel7.x86_64 9/46
Verifying : atlas-3.10.1-12.el7.x86_64 10/46
Verifying : SuperLU-5.2.0-5.el7.x86_64 11/46
Verifying : lapack-3.4.2-8.el7.x86_64 12/46
Verifying : armadillo-10.8.2-1.el7.x86_64 13/46
Verifying : giflib-4.1.6-9.el7.x86_64 14/46
Verifying : blas-3.4.2-8.el7.x86_64 15/46
Verifying : shapelib-1.3.0-3.el7.x86_64 16/46
Verifying : xerces-c-3.1.1-10.el7_7.x86_64 17/46
Verifying : boost-serialization-1.53.0-28.el7.x86_64 18/46
Verifying : proj72-7.2.1-1.rhel7.x86_64 19/46
Verifying : openjpeg-libs-1.5.1-18.el7.x86_64 20/46
Verifying : libgeotiff16-1.6.0-6.rhel7.x86_64 21/46
Verifying : libtool-ltdl-2.4.2-22.el7_3.x86_64 22/46
Verifying : ogdi41-4.1.0-2.rhel7.x86_64 23/46
Verifying : hdf5-1.8.12-13.el7.x86_64 24/46
Verifying : CGAL-4.7-1.rhel7.1.x86_64 25/46
Verifying : CharLS-1.0-5.el7.x86_64 26/46
Verifying : pcre2-10.23-2.el7.x86_64 27/46
Verifying : 1:libusb-0.1.4-3.el7.x86_64 28/46
Verifying : SFCGAL-1.3.1-2.rhel7.x86_64 29/46
Verifying : libspatialite43-devel-4.3.0a-15.rhel7.x86_64 30/46
Verifying : gdal34-libs-3.4.3-4.rhel7.x86_64 31/46
Verifying : poppler-data-0.4.6-3.el7.noarch 32/46
Verifying : arpack-3.1.3-2.el7.x86_64 33/46
Verifying : geos39-3.9.2-1.rhel7.x86_64 34/46
Verifying : cfitsio-3.370-10.el7.x86_64 35/46
Verifying : netcdf-4.3.3.1-5.el7.x86_64 36/46
Verifying : gpsbabel-1.5.0-2.el7.x86_64 37/46
Verifying : libaec-1.0.4-1.el7.x86_64 38/46
Verifying : poppler-0.26.5-43.el7.1.x86_64 39/46
Verifying : libtiff-devel-4.0.3-35.el7.x86_64 40/46
Verifying : libgeotiff16-devel-1.6.0-6.rhel7.x86_64 41/46
Verifying : libdap-3.13.1-2.el7.x86_64 42/46
Verifying : geos310-3.10.3-1.rhel7.x86_64 43/46
Verifying : sqlite33-3.30.1-6.rhel7.x86_64 44/46
Verifying : postgresql15-contrib-15.5-1PGDG.rhel7.x86_64 45/46
Verifying : sqlite33-libs-3.30.1-6.rhel7.x86_64 46/46
Installed:
postgis33_15.x86_64 0:3.3.3-1.rhel7
Dependency Installed:
CGAL.x86_64 0:4.7-1.rhel7.1 CharLS.x86_64 0:1.0-5.el7
SFCGAL.x86_64 0:1.3.1-2.rhel7 SFCGAL-libs.x86_64 0:1.3.1-2.rhel7
SuperLU.x86_64 0:5.2.0-5.el7 armadillo.x86_64 0:10.8.2-1.el7
arpack.x86_64 0:3.1.3-2.el7 atlas.x86_64 0:3.10.1-12.el7
blas.x86_64 0:3.4.2-8.el7 boost-serialization.x86_64 0:1.53.0-28.el7
cfitsio.x86_64 0:3.370-10.el7 freexl.x86_64 0:1.0.6-3.el7
gdal34-libs.x86_64 0:3.4.3-4.rhel7 geos310.x86_64 0:3.10.3-1.rhel7
geos311.x86_64 0:3.11.2-1.rhel7 geos39.x86_64 0:3.9.2-1.rhel7
giflib.x86_64 0:4.1.6-9.el7 gpsbabel.x86_64 0:1.5.0-2.el7
hdf5.x86_64 0:1.8.12-13.el7 lapack.x86_64 0:3.4.2-8.el7
libaec.x86_64 0:1.0.4-1.el7 libdap.x86_64 0:3.13.1-2.el7
libgeotiff16.x86_64 0:1.6.0-6.rhel7 libgeotiff16-devel.x86_64 0:1.6.0-6.rhel7
libgta.x86_64 0:1.0.4-1.el7 libspatialite43.x86_64 0:4.3.0a-15.rhel7
libspatialite43-devel.x86_64 0:4.3.0a-15.rhel7 libtiff-devel.x86_64 0:4.0.3-35.el7
libtool-ltdl.x86_64 0:2.4.2-22.el7_3 libusb.x86_64 1:0.1.4-3.el7
libxslt.x86_64 0:1.1.28-6.el7 netcdf.x86_64 0:4.3.3.1-5.el7
ogdi41.x86_64 0:4.1.0-2.rhel7 openblas-openmp.x86_64 0:0.3.3-2.el7
openjpeg-libs.x86_64 0:1.5.1-18.el7 pcre2.x86_64 0:10.23-2.el7
poppler.x86_64 0:0.26.5-43.el7.1 poppler-data.noarch 0:0.4.6-3.el7
postgresql15-contrib.x86_64 0:15.5-1PGDG.rhel7 proj72.x86_64 0:7.2.1-1.rhel7
shapelib.x86_64 0:1.3.0-3.el7 sqlite33.x86_64 0:3.30.1-6.rhel7
sqlite33-libs.x86_64 0:3.30.1-6.rhel7 unixODBC.x86_64 0:2.3.1-14.el7
xerces-c.x86_64 0:3.1.1-10.el7_7
Complete!
6 PostgreSQL配置与管理
[root@VM-16-10-centos ~]# su - postgres
Last login: Mon Dec 25 10:53:16 CST 2023 on pts/0
-bash-4.2$ psql -U postgres
psql (15.5)
Type "help" for help.
postgres=# ALTER USER postgres WITH PASSWORD 'postgres';
(2)配置postgresql.conf,将listen_addresses = '*'。(注意前面的#要取消)
[root@VM-16-10-centos data]# cd /var/lib/pgsql/15/data
[root@VM-16-10-centos data]# vim postgresql.conf
# - Connection Settings -
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
# (change requires restart)
#port = 5432 # (change requires restart)
max_connections = 100 # (change requires restart)
#superuser_reserved_connections = 3 # (change requires restart)
#unix_socket_directories = '/var/run/postgresql, /tmp' # comma-separated list of directories
# (change requires restart)
#unix_socket_group = '' # (change requires restart)
#unix_socket_permissions = 0777 # begin with 0 to use octal notation
# (change requires restart)
#bonjour = off # advertise server via Bonjour
# (change requires restart)
#bonjour_name = '' # defaults to the computer name
# (change requires restart)
(3)配置pg_hba.conf,后面新增两行远程连接配置。配置完成之后需要重启postgres。
[root@VM-16-10-centos data]# vim pg_hba.conf
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 scram-sha-256
# IPv6 local connections:
host all all ::1/128 scram-sha-256
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 scram-sha-256
host replication all ::1/128 scram-sha-256
host all all 127.0.0.1/32 ident
host all all 0.0.0.0/0 md5
(4)服务启动停止相关语句
# postgreSQL 启动语句
systemctl start postgresql-15
# postgreSQL 停止语句
systemctl stop postgresql-15
# postgreSQL 重启语句
systemctl restart postgresql-15
7 本地连接测试
(1)使用navicat15.0.29进行连接测试:
(2)查询PostgreSQL版本:SELECT "version"();
(3)添加postgis拓展:CREATE EXTENSION postgis;
(4)查询postgis版本: