cent os 7.6 に postgreSQL 10.16 をインストールして pgAdmin 4 から接続する

本文记录了从安装新的PostgreSQL到使用pgAdmin进行连接的过程。

image.png

DB服务器
CentOS 7.6操作系统
postgreSQL 10.16数据库
※仅需在安装时需要互联网连接环境
※需要停止selinux和firewalld防火墙设置

管理服务器
Windows Server 2019
pgAdmin 4 v5.2

1. 安装postgresSQL数据库

由于CentOS7的默认软件包是PostgreSQL9.2系列,因此我们将按照PostgreSQL官方网站的指示进行安装进程。

# yum list postgre*
利用可能なパッケージ
postgresql.i686                                                       9.2.24-4.el7_8                                           base
postgresql.x86_64                                                     9.2.24-4.el7_8                                           base
postgresql-contrib.x86_64                                             9.2.24-4.el7_8                                           base
postgresql-devel.i686                                                 9.2.24-4.el7_8                                           base
postgresql-devel.x86_64                                               9.2.24-4.el7_8                                           base
postgresql-docs.x86_64                                                9.2.24-4.el7_8                                           base
postgresql-jdbc.noarch                                                9.2.1002-8.el7_8                                         updates
postgresql-jdbc-javadoc.noarch                                        9.2.1002-8.el7_8                                         updates
postgresql-libs.i686                                                  9.2.24-4.el7_8                                           base
postgresql-libs.x86_64                                                9.2.24-4.el7_8                                           base
postgresql-odbc.x86_64                                                09.03.0100-2.el7                                         base
postgresql-plperl.x86_64                                              9.2.24-4.el7_8                                           base
postgresql-plpython.x86_64                                            9.2.24-4.el7_8                                           base
postgresql-pltcl.x86_64                                               9.2.24-4.el7_8                                           base
postgresql-server.x86_64                                              9.2.24-4.el7_8                                           base
postgresql-static.i686                                                9.2.24-4.el7_8                                           base
postgresql-static.x86_64                                              9.2.24-4.el7_8                                           base
postgresql-test.x86_64                                                9.2.24-4.el7_8                                           base
postgresql-upgrade.x86_64                                             9.2.24-4.el7_8                                           base
image.png
image.png
image.png

在Linux上安装postgreSQL仓库。

yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

现在将显示要安装的postgreSQL 10版本。

# yum list postgre*
利用可能なパッケージ
postgresql-server.x86_64                                                  9.2.24-4.el7_8                                                 base       
postgresql10-server.x86_64                                                10.16-1PGDG.rhel7                                              pgdg10     
postgresql11-server.x86_64                                                11.11-1PGDG.rhel7                                              pgdg11     
postgresql12-server.x86_64                                                12.6-1PGDG.rhel7                                               pgdg12     
postgresql13-server.x86_64                                                13.2-1PGDG.rhel7                                               pgdg13     
postgresql95-server.x86_64                                                9.5.25-1PGDG.rhel7                                             pgdg95     
postgresql96-server.x86_64                                                9.6.21-1PGDG.rhel7                                             pgdg96     
yum list全文update_yum_list
# yum list postgre*

利用可能なパッケージ
postcode_95.x86_64 1.3.0-1.rhel7 pgdg95
postcode_96.x86_64 1.3.0-1.rhel7 pgdg96
postfix.x86_64 2:2.10.1-9.el7 base
postfix-perl-scripts.x86_64 2:2.10.1-9.el7 base
postfix-sysvinit.noarch 2:2.10.1-9.el7 base
postgis22_95.x86_64 2.2.7-1.rhel7 pgdg95
postgis22_95-client.x86_64 2.2.7-1.rhel7 pgdg95
postgis22_95-devel.x86_64 2.2.7-1.rhel7 pgdg95
postgis22_95-docs.x86_64 2.2.7-1.rhel7 pgdg95
postgis22_95-utils.x86_64 2.2.7-1.rhel7 pgdg95
postgis22_96.x86_64 2.2.7-1.rhel7 pgdg96
postgis22_96-client.x86_64 2.2.7-1.rhel7 pgdg96
postgis22_96-devel.x86_64 2.2.7-1.rhel7 pgdg96
postgis22_96-docs.x86_64 2.2.7-1.rhel7 pgdg96
postgis22_96-utils.x86_64 2.2.7-1.rhel7 pgdg96
postgis23_10.x86_64 2.3.7-1.rhel7 pgdg10
postgis23_10-client.x86_64 2.3.7-1.rhel7 pgdg10
postgis23_10-devel.x86_64 2.3.7-1.rhel7 pgdg10
postgis23_10-docs.x86_64 2.3.7-1.rhel7 pgdg10
postgis23_10-utils.x86_64 2.3.7-1.rhel7 pgdg10
postgis23_95.x86_64 2.3.7-1.rhel7 pgdg95
postgis23_95-client.x86_64 2.3.7-1.rhel7 pgdg95
postgis23_95-devel.x86_64 2.3.7-1.rhel7 pgdg95
postgis23_95-docs.x86_64 2.3.7-1.rhel7 pgdg95
postgis23_95-utils.x86_64 2.3.7-1.rhel7 pgdg95
postgis23_96.x86_64 2.3.7-1.rhel7 pgdg96
postgis23_96-client.x86_64 2.3.7-1.rhel7 pgdg96
postgis23_96-devel.x86_64 2.3.7-1.rhel7 pgdg96
postgis23_96-docs.x86_64 2.3.7-1.rhel7 pgdg96
postgis23_96-utils.x86_64 2.3.7-1.rhel7 pgdg96
postgis24_10.x86_64 2.4.9-3.rhel7 pgdg10
postgis24_10-client.x86_64 2.4.9-3.rhel7 pgdg10
postgis24_10-devel.x86_64 2.4.9-3.rhel7 pgdg10
postgis24_10-docs.x86_64 2.4.9-3.rhel7 pgdg10
postgis24_10-gui.x86_64 2.4.9-3.rhel7 pgdg10
postgis24_10-utils.x86_64 2.4.9-3.rhel7 pgdg10
postgis24_11.x86_64 2.4.9-3.rhel7 pgdg11
postgis24_11-client.x86_64 2.4.9-3.rhel7 pgdg11
postgis24_11-devel.x86_64 2.4.9-3.rhel7 pgdg11
postgis24_11-docs.x86_64 2.4.9-3.rhel7 pgdg11
postgis24_11-gui.x86_64 2.4.9-3.rhel7 pgdg11
postgis24_11-utils.x86_64 2.4.9-3.rhel7 pgdg11
postgis24_95.x86_64 2.4.9-3.rhel7 pgdg95
postgis24_95-client.x86_64 2.4.9-3.rhel7 pgdg95
postgis24_95-devel.x86_64 2.4.9-3.rhel7 pgdg95
postgis24_95-docs.x86_64 2.4.9-3.rhel7 pgdg95
postgis24_95-gui.x86_64 2.4.9-3.rhel7 pgdg95
postgis24_95-utils.x86_64 2.4.9-3.rhel7 pgdg95
postgis24_96.x86_64 2.4.9-3.rhel7 pgdg96
postgis24_96-client.x86_64 2.4.9-3.rhel7 pgdg96
postgis24_96-devel.x86_64 2.4.9-3.rhel7 pgdg96
postgis24_96-docs.x86_64 2.4.9-3.rhel7 pgdg96
postgis24_96-gui.x86_64 2.4.9-3.rhel7 pgdg96
postgis24_96-utils.x86_64 2.4.9-3.rhel7 pgdg96
postgis25_10.x86_64 2.5.5-4.rhel7 pgdg10
postgis25_10-client.x86_64 2.5.5-4.rhel7 pgdg10
postgis25_10-devel.x86_64 2.5.5-4.rhel7 pgdg10
postgis25_10-docs.x86_64 2.5.5-4.rhel7 pgdg10
postgis25_10-gui.x86_64 2.5.5-4.rhel7 pgdg10
postgis25_10-utils.x86_64 2.5.5-4.rhel7 pgdg10
postgis25_11.x86_64 2.5.5-4.rhel7 pgdg11
postgis25_11-client.x86_64 2.5.5-4.rhel7 pgdg11
postgis25_11-devel.x86_64 2.5.5-4.rhel7 pgdg11
postgis25_11-docs.x86_64 2.5.5-4.rhel7 pgdg11
postgis25_11-gui.x86_64 2.5.5-4.rhel7 pgdg11
postgis25_11-utils.x86_64 2.5.5-4.rhel7 pgdg11
postgis25_12.x86_64 2.5.5-4.rhel7 pgdg12
postgis25_12-client.x86_64 2.5.5-4.rhel7 pgdg12
postgis25_12-devel.x86_64 2.5.5-4.rhel7 pgdg12
postgis25_12-docs.x86_64 2.5.5-4.rhel7 pgdg12
postgis25_12-gui.x86_64 2.5.5-4.rhel7 pgdg12
postgis25_12-utils.x86_64 2.5.5-4.rhel7 pgdg12
postgis25_95.x86_64 2.5.5-2.rhel7 pgdg95
postgis25_95-client.x86_64 2.5.5-2.rhel7 pgdg95
postgis25_95-devel.x86_64 2.5.5-2.rhel7 pgdg95
postgis25_95-docs.x86_64 2.5.5-2.rhel7 pgdg95
postgis25_95-gui.x86_64 2.5.5-2.rhel7 pgdg95
postgis25_95-utils.x86_64 2.5.5-2.rhel7 pgdg95
postgis25_96.x86_64 2.5.5-4.rhel7 pgdg96
postgis25_96-client.x86_64 2.5.5-4.rhel7 pgdg96
postgis25_96-devel.x86_64 2.5.5-4.rhel7 pgdg96
postgis25_96-docs.x86_64 2.5.5-4.rhel7 pgdg96
postgis25_96-gui.x86_64 2.5.5-4.rhel7 pgdg96
postgis25_96-utils.x86_64 2.5.5-4.rhel7 pgdg96
postgis2_95.x86_64 2.2.5-1.rhel7 pgdg95
postgis2_95-client.x86_64 2.2.5-1.rhel7 pgdg95
postgis2_95-devel.x86_64 2.2.5-1.rhel7 pgdg95
postgis2_95-docs.x86_64 2.2.5-1.rhel7 pgdg95
postgis2_95-utils.x86_64 2.2.5-1.rhel7 pgdg95
postgis2_96.x86_64 2.3.2-1.rhel7 pgdg96
postgis2_96-client.x86_64 2.3.2-1.rhel7 pgdg96
postgis2_96-devel.x86_64 2.3.2-1.rhel7 pgdg96
postgis2_96-docs.x86_64 2.3.2-1.rhel7 pgdg96
postgis2_96-utils.x86_64 2.3.2-1.rhel7 pgdg96
postgis30_10.x86_64 3.0.3-7.rhel7 pgdg10
postgis30_10-client.x86_64 3.0.3-7.rhel7 pgdg10
postgis30_10-devel.x86_64 3.0.3-7.rhel7 pgdg10
postgis30_10-docs.x86_64 3.0.3-7.rhel7 pgdg10
postgis30_10-gui.x86_64 3.0.3-7.rhel7 pgdg10
postgis30_10-utils.x86_64 3.0.3-7.rhel7 pgdg10
postgis30_11.x86_64 3.0.3-7.rhel7 pgdg11
postgis30_11-client.x86_64 3.0.3-7.rhel7 pgdg11
postgis30_11-devel.x86_64 3.0.3-7.rhel7 pgdg11
postgis30_11-docs.x86_64 3.0.3-7.rhel7 pgdg11
postgis30_11-gui.x86_64 3.0.3-7.rhel7 pgdg11
postgis30_11-utils.x86_64 3.0.3-7.rhel7 pgdg11
postgis30_12.x86_64 3.0.3-7.rhel7 pgdg12
postgis30_12-client.x86_64 3.0.3-7.rhel7 pgdg12
postgis30_12-devel.x86_64 3.0.3-7.rhel7 pgdg12
postgis30_12-docs.x86_64 3.0.3-7.rhel7 pgdg12
postgis30_12-gui.x86_64 3.0.3-7.rhel7 pgdg12
postgis30_12-utils.x86_64 3.0.3-7.rhel7 pgdg12
postgis30_13.x86_64 3.0.3-7.rhel7 pgdg13
postgis30_13-client.x86_64 3.0.3-7.rhel7 pgdg13
postgis30_13-devel.x86_64 3.0.3-7.rhel7 pgdg13
postgis30_13-docs.x86_64 3.0.3-7.rhel7 pgdg13
postgis30_13-gui.x86_64 3.0.3-7.rhel7 pgdg13
postgis30_13-utils.x86_64 3.0.3-7.rhel7 pgdg13
postgis30_95.x86_64 3.0.3-3.rhel7 pgdg95
postgis30_95-client.x86_64 3.0.3-3.rhel7 pgdg95
postgis30_95-devel.x86_64 3.0.3-3.rhel7 pgdg95
postgis30_95-docs.x86_64 3.0.3-3.rhel7 pgdg95
postgis30_95-gui.x86_64 3.0.3-3.rhel7 pgdg95
postgis30_95-utils.x86_64 3.0.3-3.rhel7 pgdg95
postgis30_96.x86_64 3.0.3-7.rhel7 pgdg96
postgis30_96-client.x86_64 3.0.3-7.rhel7 pgdg96
postgis30_96-devel.x86_64 3.0.3-7.rhel7 pgdg96
postgis30_96-docs.x86_64 3.0.3-7.rhel7 pgdg96
postgis30_96-gui.x86_64 3.0.3-7.rhel7 pgdg96
postgis30_96-utils.x86_64 3.0.3-7.rhel7 pgdg96
postgis31_11.x86_64 3.1.1-3.rhel7 pgdg11
postgis31_11-client.x86_64 3.1.1-3.rhel7 pgdg11
postgis31_11-devel.x86_64 3.1.1-3.rhel7 pgdg11
postgis31_11-docs.x86_64 3.1.1-3.rhel7 pgdg11
postgis31_11-gui.x86_64 3.1.1-3.rhel7 pgdg11
postgis31_11-utils.x86_64 3.1.1-3.rhel7 pgdg11
postgis31_12.x86_64 3.1.1-3.rhel7 pgdg12
postgis31_12-client.x86_64 3.1.1-3.rhel7 pgdg12
postgis31_12-devel.x86_64 3.1.1-3.rhel7 pgdg12
postgis31_12-docs.x86_64 3.1.1-3.rhel7 pgdg12
postgis31_12-gui.x86_64 3.1.1-3.rhel7 pgdg12
postgis31_12-utils.x86_64 3.1.1-3.rhel7 pgdg12
postgis31_13.x86_64 3.1.1-3.rhel7 pgdg13
postgis31_13-client.x86_64 3.1.1-3.rhel7 pgdg13
postgis31_13-devel.x86_64 3.1.1-3.rhel7 pgdg13
postgis31_13-docs.x86_64 3.1.1-3.rhel7 pgdg13
postgis31_13-gui.x86_64 3.1.1-3.rhel7 pgdg13
postgis31_13-utils.x86_64 3.1.1-3.rhel7 pgdg13
postgresql.i686 9.2.24-4.el7_8 base
postgresql.x86_64 9.2.24-4.el7_8 base
postgresql-contrib.x86_64 9.2.24-4.el7_8 base
postgresql-devel.i686 9.2.24-4.el7_8 base
postgresql-devel.x86_64 9.2.24-4.el7_8 base
postgresql-docs.x86_64 9.2.24-4.el7_8 base
postgresql-jdbc.noarch 42.2.20-1.rhel7 pgdg-common
postgresql-jdbc-javadoc.noarch 42.2.20-1.rhel7 pgdg-common
postgresql-libs.i686 9.2.24-4.el7_8 base
postgresql-libs.x86_64 9.2.24-4.el7_8 base
postgresql-odbc.x86_64 09.03.0100-2.el7 base
postgresql-plperl.x86_64 9.2.24-4.el7_8 base
postgresql-plpython.x86_64 9.2.24-4.el7_8 base
postgresql-pltcl.x86_64 9.2.24-4.el7_8 base
postgresql-server.x86_64 9.2.24-4.el7_8 base
postgresql-static.i686 9.2.24-4.el7_8 base
postgresql-static.x86_64 9.2.24-4.el7_8 base
postgresql-test.x86_64 9.2.24-4.el7_8 base
postgresql-unit10.x86_64 7.2-1.rhel7 pgdg10
postgresql-unit11.x86_64 7.2-1.rhel7 pgdg11
postgresql-unit12.x86_64 7.2-1.rhel7.1 pgdg12
postgresql-unit13.x86_64 7.2-1.rhel7.1 pgdg13
postgresql-unit95.x86_64 7.2-1.rhel7 pgdg95
postgresql-unit96.x86_64 7.2-1.rhel7 pgdg96
postgresql-upgrade.x86_64 9.2.24-4.el7_8 base
postgresql10.x86_64 10.16-1PGDG.rhel7 pgdg10
postgresql10-contrib.x86_64 10.16-1PGDG.rhel7 pgdg10
postgresql10-devel.x86_64 10.16-1PGDG.rhel7 pgdg10
postgresql10-docs.x86_64 10.16-1PGDG.rhel7 pgdg10
postgresql10-libs.x86_64 10.16-1PGDG.rhel7 pgdg10
postgresql10-odbc.x86_64 13.00.0000-1PGDG.rhel7 pgdg10
postgresql10-plperl.x86_64 10.16-1PGDG.rhel7 pgdg10
postgresql10-plpython.x86_64 10.16-1PGDG.rhel7 pgdg10
postgresql10-plpython3.x86_64 10.16-1PGDG.rhel7 pgdg10
postgresql10-pltcl.x86_64 10.16-1PGDG.rhel7 pgdg10
postgresql10-server.x86_64 10.16-1PGDG.rhel7 pgdg10
postgresql10-tcl.x86_64 2.7.5-1.rhel7 pgdg10
postgresql10-test.x86_64 10.16-1PGDG.rhel7 pgdg10
postgresql11.x86_64 11.11-1PGDG.rhel7 pgdg11
postgresql11-contrib.x86_64 11.11-1PGDG.rhel7 pgdg11
postgresql11-devel.x86_64 11.11-1PGDG.rhel7 pgdg11
postgresql11-docs.x86_64 11.11-1PGDG.rhel7 pgdg11
postgresql11-libs.x86_64 11.11-1PGDG.rhel7 pgdg11
postgresql11-llvmjit.x86_64 11.11-1PGDG.rhel7 pgdg11
postgresql11-odbc.x86_64 13.00.0000-1PGDG.rhel7 pgdg11
postgresql11-plperl.x86_64 11.11-1PGDG.rhel7 pgdg11
postgresql11-plpython.x86_64 11.11-1PGDG.rhel7 pgdg11
postgresql11-plpython3.x86_64 11.11-1PGDG.rhel7 pgdg11
postgresql11-pltcl.x86_64 11.11-1PGDG.rhel7 pgdg11
postgresql11-server.x86_64 11.11-1PGDG.rhel7 pgdg11
postgresql11-tcl.x86_64 2.7.5-1.rhel7 pgdg11
postgresql11-test.x86_64 11.11-1PGDG.rhel7 pgdg11
postgresql12.x86_64 12.6-1PGDG.rhel7 pgdg12
postgresql12-contrib.x86_64 12.6-1PGDG.rhel7 pgdg12
postgresql12-devel.x86_64 12.6-1PGDG.rhel7 pgdg12
postgresql12-docs.x86_64 12.6-1PGDG.rhel7 pgdg12
postgresql12-libs.x86_64 12.6-1PGDG.rhel7 pgdg12
postgresql12-llvmjit.x86_64 12.6-1PGDG.rhel7 pgdg12
postgresql12-odbc.x86_64 13.00.0000-1PGDG.rhel7 pgdg12
postgresql12-odbc-debuginfo.x86_64 12.02.0000-1PGDG.rhel7 pgdg-common
postgresql12-plperl.x86_64 12.6-1PGDG.rhel7 pgdg12
postgresql12-plpython.x86_64 12.6-1PGDG.rhel7 pgdg12
postgresql12-plpython3.x86_64 12.6-1PGDG.rhel7 pgdg12
postgresql12-pltcl.x86_64 12.6-1PGDG.rhel7 pgdg12
postgresql12-server.x86_64 12.6-1PGDG.rhel7 pgdg12
postgresql12-tcl.x86_64 2.7.5-1.rhel7 pgdg12
postgresql12-test.x86_64 12.6-1PGDG.rhel7 pgdg12
postgresql13.x86_64 13.2-1PGDG.rhel7 pgdg13
postgresql13-contrib.x86_64 13.2-1PGDG.rhel7 pgdg13
postgresql13-devel.x86_64 13.2-1PGDG.rhel7 pgdg13
postgresql13-docs.x86_64 13.2-1PGDG.rhel7 pgdg13
postgresql13-libs.x86_64 13.2-1PGDG.rhel7 pgdg13
postgresql13-llvmjit.x86_64 13.2-1PGDG.rhel7 pgdg13
postgresql13-odbc.x86_64 13.00.0000-1PGDG.rhel7 pgdg13
postgresql13-plperl.x86_64 13.2-1PGDG.rhel7 pgdg13
postgresql13-plpython3.x86_64 13.2-1PGDG.rhel7 pgdg13
postgresql13-pltcl.x86_64 13.2-1PGDG.rhel7 pgdg13
postgresql13-server.x86_64 13.2-1PGDG.rhel7 pgdg13
postgresql13-test.x86_64 13.2-1PGDG.rhel7 pgdg13
postgresql95.x86_64 9.5.25-1PGDG.rhel7 pgdg95
postgresql95-contrib.x86_64 9.5.25-1PGDG.rhel7 pgdg95
postgresql95-devel.x86_64 9.5.25-1PGDG.rhel7 pgdg95
postgresql95-docs.x86_64 9.5.25-1PGDG.rhel7 pgdg95
postgresql95-libs.x86_64 9.5.25-1PGDG.rhel7 pgdg95
postgresql95-odbc.x86_64 13.00.0000-1PGDG.rhel7 pgdg95
postgresql95-plperl.x86_64 9.5.25-1PGDG.rhel7 pgdg95
postgresql95-plpython.x86_64 9.5.25-1PGDG.rhel7 pgdg95
postgresql95-plpython3.x86_64 9.5.25-1PGDG.rhel7 pgdg95
postgresql95-pltcl.x86_64 9.5.25-1PGDG.rhel7 pgdg95
postgresql95-server.x86_64 9.5.25-1PGDG.rhel7 pgdg95
postgresql95-tcl.x86_64 2.7.5-1.rhel7 pgdg95
postgresql95-test.x86_64 9.5.25-1PGDG.rhel7 pgdg95
postgresql96.x86_64 9.6.21-1PGDG.rhel7 pgdg96
postgresql96-contrib.x86_64 9.6.21-1PGDG.rhel7 pgdg96
postgresql96-devel.x86_64 9.6.21-1PGDG.rhel7 pgdg96
postgresql96-docs.x86_64 9.6.21-1PGDG.rhel7 pgdg96
postgresql96-libs.x86_64 9.6.21-1PGDG.rhel7 pgdg96
postgresql96-odbc.x86_64 13.00.0000-1PGDG.rhel7 pgdg96
postgresql96-plperl.x86_64 9.6.21-1PGDG.rhel7 pgdg96
postgresql96-plpython.x86_64 9.6.21-1PGDG.rhel7 pgdg96
postgresql96-plpython3.x86_64 9.6.21-1PGDG.rhel7 pgdg96
postgresql96-pltcl.x86_64 9.6.21-1PGDG.rhel7 pgdg96
postgresql96-server.x86_64 9.6.21-1PGDG.rhel7 pgdg96
postgresql96-tcl.x86_64 2.7.5-1.rhel7 pgdg96
postgresql96-test.x86_64 9.6.21-1PGDG.rhel7 pgdg96
postgresql_anonymizer10.noarch 0.3.1-1.rhel7 pgdg10
postgresql_anonymizer10.x86_64 0.7.1-1.rhel7 pgdg10
postgresql_anonymizer11.noarch 0.3.1-1.rhel7 pgdg11
postgresql_anonymizer11.x86_64 0.7.1-1.rhel7 pgdg11
postgresql_anonymizer12.noarch 0.3.1-1.rhel7.1 pgdg12
postgresql_anonymizer12.x86_64 0.7.1-1.rhel7 pgdg12
postgresql_anonymizer13.x86_64 0.7.1-1.rhel7 pgdg13
postgresql_anonymizer95.noarch 0.3.1-1.rhel7 pgdg95
postgresql_anonymizer95.x86_64 0.7.1-1.rhel7 pgdg95
postgresql_anonymizer96.noarch 0.3.1-1.rhel7 pgdg96
postgresql_anonymizer96.x86_64 0.7.1-1.rhel7 pgdg96
postgresql_anonymizer_10.x86_64 0.8.1-1.rhel7 pgdg10
postgresql_anonymizer_11.x86_64 0.8.1-1.rhel7 pgdg11
postgresql_anonymizer_12.x86_64 0.8.1-1.rhel7 pgdg12
postgresql_anonymizer_13.x86_64 0.8.1-1.rhel7 pgdg13
postgresql_anonymizer_95.x86_64 0.8.1-1.rhel7 pgdg95
postgresql_anonymizer_96.x86_64 0.8.1-1.rhel7 pgdg96
postgresql_autodoc.noarch 1.41.1-1.rhel7.1 pgdg-common
postgresql_faker_10.noarch 0.3.0-1.rhel7 pgdg10
postgresql_faker_11.noarch 0.3.0-1.rhel7 pgdg11
postgresql_faker_12.noarch 0.3.0-1.rhel7 pgdg12
postgresql_faker_13.noarch 0.3.0-1.rhel7 pgdg13
postgresql_faker_96.noarch 0.3.0-1.rhel7 pgdg96

我想安装并使用这次要用的PostgreSQL 10。

[root@cent76-d1 ~]# yum list postgresql10*
利用可能なパッケージ
postgresql10.x86_64                                                       10.16-1PGDG.rhel7                                                   pgdg10
postgresql10-contrib.x86_64                                               10.16-1PGDG.rhel7                                                   pgdg10
postgresql10-devel.x86_64                                                 10.16-1PGDG.rhel7                                                   pgdg10
postgresql10-docs.x86_64                                                  10.16-1PGDG.rhel7                                                   pgdg10
postgresql10-libs.x86_64                                                  10.16-1PGDG.rhel7                                                   pgdg10
postgresql10-odbc.x86_64                                                  13.00.0000-1PGDG.rhel7                                              pgdg10
postgresql10-plperl.x86_64                                                10.16-1PGDG.rhel7                                                   pgdg10
postgresql10-plpython.x86_64                                              10.16-1PGDG.rhel7                                                   pgdg10
postgresql10-plpython3.x86_64                                             10.16-1PGDG.rhel7                                                   pgdg10
postgresql10-pltcl.x86_64                                                 10.16-1PGDG.rhel7                                                   pgdg10
postgresql10-server.x86_64                                                10.16-1PGDG.rhel7                                                   pgdg10
postgresql10-tcl.x86_64                                                   2.7.5-1.rhel7                                                       pgdg10
postgresql10-test.x86_64                                                  10.16-1PGDG.rhel7                                                   pgdg10
[root@cent76-d1 ~]# 


[root@cent76-d1 ~]# yum install postgresql10*
<<<中略>>>
====================================================================================================================================================
 Package                                    アーキテクチャー           バージョン                                 リポジトリー                 容量
====================================================================================================================================================
インストール中:
 postgresql10                               x86_64                     10.16-1PGDG.rhel7                          pgdg10                      1.6 M
 postgresql10-contrib                       x86_64                     10.16-1PGDG.rhel7                          pgdg10                      589 k
 postgresql10-devel                         x86_64                     10.16-1PGDG.rhel7                          pgdg10                      2.0 M
 postgresql10-docs                          x86_64                     10.16-1PGDG.rhel7                          pgdg10                       11 M
 postgresql10-libs                          x86_64                     10.16-1PGDG.rhel7                          pgdg10                      358 k
 postgresql10-odbc                          x86_64                     13.00.0000-1PGDG.rhel7                     pgdg10                      302 k
 postgresql10-plperl                        x86_64                     10.16-1PGDG.rhel7                          pgdg10                       61 k
 postgresql10-plpython                      x86_64                     10.16-1PGDG.rhel7                          pgdg10                       90 k
 postgresql10-plpython3                     x86_64                     10.16-1PGDG.rhel7                          pgdg10                       89 k
 postgresql10-pltcl                         x86_64                     10.16-1PGDG.rhel7                          pgdg10                       40 k
 postgresql10-server                        x86_64                     10.16-1PGDG.rhel7                          pgdg10                      4.5 M
 postgresql10-tcl                           x86_64                     2.7.5-1.rhel7                              pgdg10                      349 k
 postgresql10-test                          x86_64                     10.16-1PGDG.rhel7                          pgdg10                      1.6 M
依存性関連でのインストールをします:
 libicu-devel                               x86_64                     50.2-4.el7_7                               base                        703 k
 libtirpc                                   x86_64                     0.2.4-0.16.el7                             base                         89 k
 perl                                       x86_64                     4:5.16.3-299.el7_9                         updates                     8.0 M
 perl-Carp                                  noarch                     1.26-244.el7                               base                         19 k
 perl-Encode                                x86_64                     2.51-7.el7                                 base                        1.5 M
 perl-Exporter                              noarch                     5.68-3.el7                                 base                         28 k
 perl-File-Path                             noarch                     2.09-2.el7                                 base                         26 k
 perl-File-Temp                             noarch                     0.23.01-3.el7                              base                         56 k
 perl-Filter                                x86_64                     1.49-3.el7                                 base                         76 k
 perl-Getopt-Long                           noarch                     2.40-3.el7                                 base                         56 k
 perl-HTTP-Tiny                             noarch                     0.033-3.el7                                base                         38 k
 perl-PathTools                             x86_64                     3.40-5.el7                                 base                         82 k
 perl-Pod-Escapes                           noarch                     1:1.04-299.el7_9                           updates                      52 k
 perl-Pod-Perldoc                           noarch                     3.20-4.el7                                 base                         87 k
 perl-Pod-Simple                            noarch                     1:3.28-4.el7                               base                        216 k
 perl-Pod-Usage                             noarch                     1.63-3.el7                                 base                         27 k
 perl-Scalar-List-Utils                     x86_64                     1.27-248.el7                               base                         36 k
 perl-Socket                                x86_64                     2.010-5.el7                                base                         49 k
 perl-Storable                              x86_64                     2.45-3.el7                                 base                         77 k
 perl-Text-ParseWords                       noarch                     3.29-4.el7                                 base                         14 k
 perl-Time-HiRes                            x86_64                     4:1.9725-3.el7                             base                         45 k
 perl-Time-Local                            noarch                     1.2300-2.el7                               base                         24 k
 perl-constant                              noarch                     1.27-2.el7                                 base                         19 k
 perl-libs                                  x86_64                     4:5.16.3-299.el7_9                         updates                     690 k
 perl-macros                                x86_64                     4:5.16.3-299.el7_9                         updates                      44 k
 perl-parent                                noarch                     1:0.225-244.el7                            base                         12 k
 perl-podlators                             noarch                     2.5.1-3.el7                                base                        112 k
 perl-threads                               x86_64                     1.87-4.el7                                 base                         49 k
 perl-threads-shared                        x86_64                     1.43-6.el7                                 base                         39 k
 python3                                    x86_64                     3.6.8-18.el7                               updates                      70 k
 python3-libs                               x86_64                     3.6.8-18.el7                               updates                     6.9 M
 python3-pip                                noarch                     9.0.3-8.el7                                base                        1.6 M
 python3-setuptools                         noarch                     39.2.0-10.el7                              base                        629 k
 tcl                                        x86_64                     1:8.5.13-8.el7                             base                        1.9 M
 unixODBC                                   x86_64                     2.3.1-14.el7                               base                        413 k
依存性関連での更新をします:
 libicu                                     x86_64                     50.2-4.el7_7                               base                        6.9 M
<<<中略>>>
完了しました!

2. PostgreSQL的自动启动和执行

启用自动启动进程。

[root@cent76-d1 ~]# systemctl enable postgresql-10

[root@cent76-d1 ~]# systemctl is-enabled postgresql-10
enabled
[root@cent76-d1 ~]# 

我尝试启动进程,但是出现了错误提示。

[root@cent76-d1 ~]# systemctl start postgresql-10
Job for postgresql-10.service failed because the control process exited with error code. See "systemctl status postgresql-10.service" and "journalctl -xe" for details.
[root@cent76-d1 ~]# 

错误的原因是因为没有执行initdb处理,所以现在我们要执行initdb处理。

[root@cent76-d1 ~]# /usr/pgsql-10/bin/postgresql-10-setup initdb
Initializing database ... OK

[root@cent76-d1 ~]# 

用这个可以顺利启动进程。

[root@cent76-d1 ~]# systemctl start postgresql-10
[root@cent76-d1 ~]# 

3. 本地连接确认

首先,在本地进行连接测试。

[root@cent76-d1 ~]# sudo -u postgres psql -U postgres
could not change directory to "/root": 許可がありません
psql (10.16)
Type "help" for help.

postgres=# 
postgres=# \q
[root@cent76-d1 ~]# 

4. 远程连接配置(postgresql.conf)

为了定义接受远程连接的自段,需要在下面的配置文件中添加附加内容。添加部分在最顶行。

文件路径:/var/lib/pgsql/10/data/postgresql.conf

listen_addresses = '*'                  ### CUSTOM ADD ###
#listen_addresses = 'localhost'         # what IP address(es) to listen on;

5.远程连接设置(pg_hba.conf)

为了设置允许与远程连接的片段进行连接,我们将在以下的配置文件中进行追加。新增的部分位于最后两行。

文件路径:/var/lib/pgsql/10/data/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            ident
# IPv6 local connections:
host    all             all             ::1/128                 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
local   replication     all                                     peer
host    replication     all             127.0.0.1/32            ident
host    replication     all             ::1/128                 ident

### CUSTOM ADD ###
host    all             postgres        10.0.1.0/24             trust
項目内容説明TYPEhost認証対象。’host’は任意の対象。DATABASEall対象DB。’all’は全てのDBを対象。USERpostgres対象ユーザ。’postgres’でスーパーユーザのみの指定ADDRESS10.0.1.0/24接続元。指定のセグメントをCIDR表記で記載。METHODtrust認証方式。trustは認証無しでログイン可能。

如果将认证方式设置为” trust”,只需使用用户名即可连接,因此建议在合适的构建时间将认证方式更改为md5认证或对等认证。

通过pgAdmin进行连接。

image.png
image.png
image.png
image.png

请在中国生活中引用

广告
将在 10 秒后关闭
bannerAds