PostgreSQL 安装部署系列:使用YUM 方式在Centos 7.9 安装指定 PostgreSQL -15版本数据库

一、前言

     千里之行始于足下,想学习一门数据库,首先要从安装部署开始,先拥有一套属于自己的学习测试库。为了更好的学习该数据库,可以选择一个在企业界使用率比较普及的操作系统,选择稳定版本的操作系统;如果不是为了研究数据库各版本软件差异,不是为了钻研最新版本数据库的新特性,建议选择一款比较新且稳定成熟的数据库版本软件。

       PostGreSQL作为一款优秀的开源数据库,在国内外广受欢迎,被用于很多行业,在国内外也有很多的PG fans。

       PostGreSQL安装的方式有多种,比如在Linux或MAC操作系统上,可以选择yum、二进制、源码方式安装。

       相对于Windows操作系统,PostGreSQL更多安装在Linux等操作系统上,所以对于Windows如何安装PostGreSQL不在本系列讨论范围内。

       作为PostGreSQL安装部署系列篇,本次讲解如何在Linux上使用YUM来安装,本次选择采用Centos 7.9操作系统来验证。

接下来,安装部署,走起。

二、前期准备

2.1 配置YUM源

      如果你的Linux能联网,建议选择配置一个YUM源,比如选择使用比较普遍的阿里yum源。如何配置YUM源,大家可以搜下网络介绍,本次不作为分享内容,大家可以自行搜索部署。

2.2 下载软件

登录PostGreSQL官网地址:https://www.postgresql.org/download/,进入到如下界面。

image20231228144116495.png

参照上图,选择对应的操作系统,本次选择Linux,然后选择对应的Linux的发行版,本次选择Red Hat/Rocky/AlmaLinux发行版,如下所示。

image20231228144533320.png

然后进入到https://www.postgresql.org/download/linux/redhat/对应的页面,然后选择相应的数据库版本、对应的操作系统版本、对应的架构模式,本次选择PostGreSQL 15版本,如下所示。

image20231228144801254.png

三、安装部署

根据https://www.postgresql.org/download/linux/redhat/所填写内容,拷贝相应命令分别执行。

3.1 安装仓库RPM包

# 使用root用户执行如下命令:
[root@host19c-node1 ~]# sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm-- 上述命令执行结果如下:
pgdg-redhat-repo-latest.noarch.rpm                                                                                                                                                                                    | 9.0 kB  00:00:00     
Examining /var/tmp/yum-root-CYlXMy/pgdg-redhat-repo-latest.noarch.rpm: pgdg-redhat-repo-42.0-35PGDG.noarch
Marking /var/tmp/yum-root-CYlXMy/pgdg-redhat-repo-latest.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package pgdg-redhat-repo.noarch 0:42.0-35PGDG will be installed
--> Finished Dependency ResolutionDependencies Resolved=============================================================================================================================================================================================================================================Package                                                  Arch                                           Version                                               Repository                                                               Size
=============================================================================================================================================================================================================================================
Installing:pgdg-redhat-repo                                         noarch                                         42.0-35PGDG                                           /pgdg-redhat-repo-latest.noarch                                          13 kTransaction Summary
=============================================================================================================================================================================================================================================
Install  1 PackageTotal size: 13 k
Installed size: 13 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
R-java-3.6.0-1.el7.x86_64 has missing requires of java-headless
ant-1.9.4-2.el7.noarch has missing requires of java-devel >= ('0', '1.5.0', None)
rlwrap-0.43-2.el7.x86_64 has missing requires of /usr/bin/python3.6Installing : pgdg-redhat-repo-42.0-35PGDG.noarch                                                                                                                                                                                       1/1 Verifying  : pgdg-redhat-repo-42.0-35PGDG.noarch                                                                                                                                                                                       1/1 Installed:pgdg-redhat-repo.noarch 0:42.0-35PGDG                                                                                                                                                                                                      Complete!

image20231227160156998.png

上述命令执行完毕后,可以使用yum search postgresql命令来查看安装了哪些PostGreSQL数据库相关软件。

# 使用yum search postgresql命令查看相关数据库软件
[root@host19c-node1 ~]# yum search postgresql
-- 上述命令执行结果如下:
pgdg-common/7/x86_64/signature                                                                                                                                                                                        |  198 B  00:00:00     
pgdg-common/7/x86_64/signature                                                                                                                                                                                        | 2.9 kB  00:00:00 !!! 
pgdg11/7/x86_64/signature                                                                                                                                                                                             |  198 B  00:00:00     
pgdg11/7/x86_64/signature                                                                                                                                                                                             | 3.6 kB  00:00:00 !!! 
pgdg12/7/x86_64/signature                                                                                                                                                                                             |  198 B  00:00:00     
pgdg12/7/x86_64/signature                                                                                                                                                                                             | 3.6 kB  00:00:00 !!! 
pgdg13/7/x86_64/signature                                                                                                                                                                                             |  198 B  00:00:00     
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 f0f8Package    : pgdg-redhat-repo-42.0-35PGDG.noarch (installed)From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Is this ok [y/N]: y  
pgdg13/7/x86_64/signature                                                                                                                                                                                             | 3.6 kB  00:00:38 !!! 
pgdg14/7/x86_64/signature                                                                                                                                                                                             |  198 B  00:00:00     
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 f0f8Package    : pgdg-redhat-repo-42.0-35PGDG.noarch (installed)From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Is this ok [y/N]: N
pgdg14/7/x86_64/signature                                                                                                                                                                                             | 3.6 kB  00:00:12 !!! 
https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-7-x86_64/repodata/repomd.xml: [Errno -1] Gpg Keys not imported, cannot verify repomd.xml for repo pgdg14
Trying other mirror.One of the configured repositories failed (PostgreSQL 14 for RHEL / CentOS 7 - x86_64),and yum doesn't have enough cached data to continue. At this point the onlysafe thing yum can do is fail. There are a few ways to work "fix" this:1. Contact the upstream for the repository and get them to fix the problem.2. Reconfigure the baseurl/etc. for the repository, to point to a workingupstream. This is most often useful if you are using a newerdistribution release than is supported by the repository (and thepackages for the previous distribution release still work).3. Run the command with the repository temporarily disabledyum --disablerepo=pgdg14 ...4. Disable the repository permanently, so yum won't use it by default. Yumwill then just ignore the repository until you permanently enable itagain or use --enablerepo for temporary usage:yum-config-manager --disable pgdg14orsubscription-manager repos --disable=pgdg145. Configure the failing repository to be skipped, if it is unavailable.Note that yum will try to contact the repo. when it runs most commands,so will have to try and fail each time (and thus. yum will be be muchslower). If it is a very temporary problem though, this is often a nicecompromise:yum-config-manager --save --setopt=pgdg14.skip_if_unavailable=truefailure: repodata/repomd.xml from pgdg14: [Errno 256] No more mirrors to try.
https://download.postgresql.org/pub/repos/yum/14/redhat/rhel-7-x86_64/repodata/repomd.xml: [Errno -1] Gpg Keys not imported, cannot verify repomd.xml for repo pgdg14

可以发现在执行yum search postgresql根据提示输入N后,会有failure: repodata/repomd.xml from pgdg14: [Errno 256] No more mirrors to try的报错信息。

根据上述报错查询了网上信息,根据https://www.postgresql.org/message-id/C7C14870-90FE-40B8-93CF-1068B1D43F78%40contoso.com这篇文章内容显示是遇到了一个bug,详细信息如下:

image20231227160317085.png

3.2 安装数据库

接下来,安装PostGreSQL 15版本数据库,详细信息如下:

# 使用root用户执行yum install -y postgresql15-server命令。
[root@host19c-node1 ~]# sudo yum install -y postgresql15-server
-- 上述命令执行结果如下:
base                                                                                                                                                                                                                  | 3.6 kB  00:00:00     
epel                                                                                                                                                                                                                  | 4.7 kB  00:00:00     
extras                                                                                                                                                                                                                | 2.9 kB  00:00:00     
pgdg-common/7/x86_64/signature                                                                                                                                                                                        |  198 B  00:00:00     
pgdg-common/7/x86_64/signature                                                                                                                                                                                        | 2.9 kB  00:00:00 !!! 
pgdg11/7/x86_64/signature                                                                                                                                                                                             |  198 B  00:00:00     
pgdg11/7/x86_64/signature                                                                                                                                                                                             | 3.6 kB  00:00:00 !!! 
pgdg12/7/x86_64/signature                                                                                                                                                                                             |  198 B  00:00:00     
pgdg12/7/x86_64/signature                                                                                                                                                                                             | 3.6 kB  00:00:00 !!! 
pgdg13/7/x86_64/signature                                                                                                                                                                                             |  198 B  00:00:00     
pgdg13/7/x86_64/signature                                                                                                                                                                                             | 3.6 kB  00:00:00 !!! 
pgdg14/7/x86_64/signature                                                                                                                                                                                             |  198 B  00:00:00     
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 f0f8Package    : pgdg-redhat-repo-42.0-35PGDG.noarch (installed)From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
pgdg14/7/x86_64/signature                                                                                                                                                                                             | 3.6 kB  00:00:00 !!! 
pgdg15/7/x86_64/signature                                                                                                                                                                                             |  198 B  00:00:00     
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 f0f8Package    : pgdg-redhat-repo-42.0-35PGDG.noarch (installed)From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
pgdg15/7/x86_64/signature                                                                                                                                                                                             | 3.6 kB  00:00:00 !!! 
updates                                                                                                                                                                                                               | 2.9 kB  00:00:00     
(1/11): pgdg12/7/x86_64/group_gz                                                                                                                                                                                      |  245 B  00:00:01     
(2/11): pgdg13/7/x86_64/group_gz                                                                                                                                                                                      |  246 B  00:00:00     
(3/11): pgdg11/7/x86_64/group_gz                                                                                                                                                                                      |  245 B  00:00:01     
(4/11): pgdg12/7/x86_64/primary_db                                                                                                                                                                                    | 416 kB  00:00:01     
(5/11): pgdg14/7/x86_64/primary_db                                                                                                                                                                                    | 249 kB  00:00:00     
(6/11): pgdg11/7/x86_64/primary_db                                                                                                                                                                                    | 524 kB  00:00:02     
(7/11): pgdg14/7/x86_64/group_gz                                                                                                                                                                                      |  244 B  00:00:00     
(8/11): pgdg15/7/x86_64/group_gz                                                                                                                                                                                      |  246 B  00:00:00     
(9/11): pgdg13/7/x86_64/primary_db                                                                                                                                                                                    | 337 kB  00:00:01     
(10/11): pgdg15/7/x86_64/primary_db                                                                                                                                                                                   | 156 kB  00:00:00     
(11/11): pgdg-common/7/x86_64/primary_db                                                                                                                                                                              | 203 kB  00:00:02     
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: libpq.so.5()(64bit) for package: postgresql15-server-15.5-1PGDG.rhel7.x86_64
--> Running transaction check
---> 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 ResolutionDependencies Resolved=============================================================================================================================================================================================================================================Package                                                         Arch                                               Version                                                         Repository                                          Size
=============================================================================================================================================================================================================================================
Installing:postgresql15-server                                             x86_64                                             15.5-1PGDG.rhel7                                                pgdg15                                             5.8 M
Installing for dependencies:postgresql15                                                    x86_64                                             15.5-1PGDG.rhel7                                                pgdg15                                             1.6 Mpostgresql15-libs                                               x86_64                                             15.5-1PGDG.rhel7                                                pgdg15                                             284 kTransaction Summary
=============================================================================================================================================================================================================================================
Install  1 Package (+2 Dependent packages)Total download size: 7.7 M
Installed size: 34 M
Downloading packages:
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                                                       ]  0.0 B/s | 112 kB  --:--:-- ETA 
Public key for postgresql15-libs-15.5-1PGDG.rhel7.x86_64.rpm is not installed
(1/3): postgresql15-libs-15.5-1PGDG.rhel7.x86_64.rpm                                                                                                                                                                  | 284 kB  00:00:01     
(2/3): postgresql15-server-15.5-1PGDG.rhel7.x86_64.rpm                                                                                                                                                                | 5.8 MB  00:00:01     
(3/3): postgresql15-15.5-1PGDG.rhel7.x86_64.rpm                                                                                                                                                                       | 1.6 MB  00:00:05     
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                                                        1.3 MB/s | 7.7 MB  00:00:05     
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 f0f8Package    : pgdg-redhat-repo-42.0-35PGDG.noarch (installed)From       : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : postgresql15-libs-15.5-1PGDG.rhel7.x86_64                                                                                                                                                                                 1/3 Installing : postgresql15-15.5-1PGDG.rhel7.x86_64                                                                                                                                                                                      2/3 Installing : postgresql15-server-15.5-1PGDG.rhel7.x86_64                                                                                                                                                                               3/3 Verifying  : postgresql15-15.5-1PGDG.rhel7.x86_64                                                                                                                                                                                      1/3 Verifying  : postgresql15-server-15.5-1PGDG.rhel7.x86_64                                                                                                                                                                               2/3 Verifying  : postgresql15-libs-15.5-1PGDG.rhel7.x86_64                                                                                                                                                                                 3/3 Installed:postgresql15-server.x86_64 0:15.5-1PGDG.rhel7                                                                                                                                                                                              Dependency Installed:postgresql15.x86_64 0:15.5-1PGDG.rhel7                                                                             postgresql15-libs.x86_64 0:15.5-1PGDG.rhel7                                                                            Complete!

3.3 初始化数据库

执行yum install -y postgresql15-server安装数据库,可以查看到数据库的相关命令在/usr/pgsql-15/bin目录下。

[root@host19c-node1 pgsql-15]# pwd
/usr/pgsql-15
[root@host19c-node1 pgsql-15]# ls -lrt
total 12
drwxr-xr-x 2 root root 4096 Dec 27 16:03 bin
drwxr-xr-x 3 root root 4096 Dec 27 16:03 lib
drwxr-xr-x 7 root root 4096 Dec 27 16:03 share

image20231228150748615.png

接下来来初始化数据库,操作命令如下:

 
# 使用root用户执行/usr/pgsql-15/bin/postgresql-15-setup initdb
[root@host19c-node1 ~]# sudo /usr/pgsql-15/bin/postgresql-15-setup initdb
-- 上述命令执行结果如下:
Initializing database ... OK# 可以进行如下配置设置服务器重启后数据库自启动。# 使用root用户执行systemctl enable postgresql-15
[root@host19c-node1 ~]# 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用户执行systemctl start postgresql-15启动数据库
[root@host19c-node1 ~]# sudo systemctl start postgresql-15# 使用systemctl status postgresql-15命令查看数据库启动状态
[root@host19c-node1 ~]# sudo systemctl status postgresql-15
● postgresql-15.service - PostgreSQL 15 database serverLoaded: loaded (/usr/lib/systemd/system/postgresql-15.service; enabled; vendor preset: disabled)Active: active (running) since Wed 2023-12-27 16:07:39 CST; 8s agoDocs: https://www.postgresql.org/docs/15/static/Process: 35602 ExecStartPre=/usr/pgsql-15/bin/postgresql-15-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)Main PID: 35609 (postmaster)Tasks: 7Memory: 15.0MCGroup: /system.slice/postgresql-15.service├─35609 /usr/pgsql-15/bin/postmaster -D /var/lib/pgsql/15/data/├─35610 postgres: logger ├─35611 postgres: checkpointer ├─35612 postgres: background writer ├─35614 postgres: walwriter ├─35615 postgres: autovacuum launcher └─35616 postgres: logical replication launcher Dec 27 16:07:39 host19c-node1 systemd[1]: Starting PostgreSQL 15 database server...
Dec 27 16:07:39 host19c-node1 postmaster[35609]: 2023-12-27 16:07:39.363 CST [35609] LOG:  redirecting log output to logging collector process
Dec 27 16:07:39 host19c-node1 postmaster[35609]: 2023-12-27 16:07:39.363 CST [35609] HINT:  Future log output will appear in directory "log".
Dec 27 16:07:39 host19c-node1 systemd[1]: Started PostgreSQL 15 database server.

image20231227160827028.png

数据库初始并启动后,可以查看到数据库的默认安装路径在/var/lib/pgsql/15/目录下,相关信息如下:

[root@host19c-node1 ~]# cd /var/lib/pgsql/15/
[root@host19c-node1 15]# ll
total 8
drwx------  2 postgres postgres    6 Nov  9 04:34 backups
drwx------ 20 postgres postgres 4096 Dec 27 16:07 data
-rw-------  1 postgres postgres  921 Dec 27 16:06 initdb.log
[root@host19c-node1 15]# ls -lrt ./data/
total 68
-rw------- 1 postgres postgres     3 Dec 27 16:06 PG_VERSION
drwx------ 2 postgres postgres     6 Dec 27 16:06 pg_twophase
drwx------ 2 postgres postgres     6 Dec 27 16:06 pg_tblspc
drwx------ 2 postgres postgres     6 Dec 27 16:06 pg_stat_tmp
drwx------ 2 postgres postgres     6 Dec 27 16:06 pg_snapshots
drwx------ 2 postgres postgres     6 Dec 27 16:06 pg_serial
drwx------ 2 postgres postgres     6 Dec 27 16:06 pg_replslot
drwx------ 2 postgres postgres     6 Dec 27 16:06 pg_notify
drwx------ 4 postgres postgres    36 Dec 27 16:06 pg_multixact
drwx------ 2 postgres postgres     6 Dec 27 16:06 pg_dynshmem
drwx------ 2 postgres postgres     6 Dec 27 16:06 pg_commit_ts
-rw------- 1 postgres postgres 29460 Dec 27 16:06 postgresql.conf
-rw------- 1 postgres postgres    88 Dec 27 16:06 postgresql.auto.conf
-rw------- 1 postgres postgres  1636 Dec 27 16:06 pg_ident.conf
-rw------- 1 postgres postgres  4577 Dec 27 16:06 pg_hba.conf
drwx------ 3 postgres postgres    60 Dec 27 16:06 pg_wal
drwx------ 2 postgres postgres    18 Dec 27 16:06 pg_xact
drwx------ 2 postgres postgres    18 Dec 27 16:06 pg_subtrans
drwx------ 5 postgres postgres    33 Dec 27 16:06 base
drwx------ 2 postgres postgres    32 Dec 27 16:07 log
-rw------- 1 postgres postgres    30 Dec 27 16:07 current_logfiles
-rw------- 1 postgres postgres    58 Dec 27 16:07 postmaster.opts
drwx------ 2 postgres postgres     6 Dec 27 16:07 pg_stat
-rw------- 1 postgres postgres   104 Dec 27 16:07 postmaster.pid
drwx------ 2 postgres postgres  4096 Dec 27 16:08 global
drwx------ 4 postgres postgres    68 Dec 27 16:12 pg_logical

image20231227161408590.png

四、验证测试

数据库安装后,我们来进行简单的验证测试。

使用yum安装数据库后,默认会创建postgres用户。

# 切换到postgres用户
[root@host19c-node1 ~]# su - postgres
Last login: Wed Dec 27 16:09:13 CST 2023 on pts/5
-bash-4.2$ psql
psql (15.5)
Type "help" for help.# 查看初始化后的数据库默认库和用户
postgres=# \d
Did not find any relations.
postgres=# \lList of databasesName    |  Owner   | Encoding |   Collate   |    Ctype    | ICU Locale | Locale Provider |   Access privileges   
-----------+----------+----------+-------------+-------------+------------+-----------------+-----------------------postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | =c/postgres          +|          |          |             |             |            |                 | postgres=CTc/postgrestemplate1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |            | libc            | =c/postgres          +|          |          |             |             |            |                 | postgres=CTc/postgres
(3 rows)# 创建一个测试库
postgres=# CREATE DATABASE pg15;CREATE DATABASE
postgres=# 
postgres=# \c pg15;
You are now connected to database "pg15" as user "postgres".
pg15=# CREATE TABLE pgtb (
pg15(#     id SERIAL PRIMARY KEY,
pg15(#     username VARCHAR(50) NOT NULL,
pg15(#     email VARCHAR(100) NOT NULL UNIQUE,
pg15(#     created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
pg15(# );
CREATE TABLE
pg15=# 
pg15=# INSERT INTO pgtb (username, email) VALUES
pg15-# ('user1', 'user1@example.com'),
pg15-# ('user2', 'user2@example.com');INSERT 0 2
pg15=# 
pg15=# select * from pgtb;id | username |       email       |         created_at         
----+----------+-------------------+----------------------------1 | user1    | user1@example.com | 2023-12-27 16:37:16.2188112 | user2    | user2@example.com | 2023-12-27 16:37:16.218811
(2 rows)pg15=# 

image20231227163814126.png

万里长征已开启第一步,现在你已拥有了一个PG数据库,请开启你的PG学习之旅吧。

五、卸载数据库

卸载使用YUM安装的数据库也比较简单,可以采用yum remove postgresql15-server卸载安装的数据库。

[root@host19c-node1 ~]# yum remove postgresql15-server
Resolving Dependencies
--> Running transaction check
---> Package postgresql15-server.x86_64 0:15.5-1PGDG.rhel7 will be erased
--> Processing Dependency: postgresql15-server(x86-64) = 15.5-1PGDG.rhel7 for package: postgresql15-contrib-15.5-1PGDG.rhel7.x86_64
--> Running transaction check
---> Package postgresql15-contrib.x86_64 0:15.5-1PGDG.rhel7 will be erased
--> Finished Dependency ResolutionDependencies Resolved=============================================================================================================================================================================================================================================Package                                                          Arch                                               Version                                                       Repository                                           Size
=============================================================================================================================================================================================================================================
Removing:postgresql15-server                                              x86_64                                             15.5-1PGDG.rhel7                                              @pgdg15                                              24 M
Removing for dependencies:postgresql15-contrib                                             x86_64                                             15.5-1PGDG.rhel7                                              @pgdg15                                             2.5 MTransaction Summary
=============================================================================================================================================================================================================================================
Remove  1 Package (+1 Dependent package)Installed size: 27 M
Is this ok [y/N]: y
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionErasing    : postgresql15-contrib-15.5-1PGDG.rhel7.x86_64                                                                                                                                                                              1/2 Erasing    : postgresql15-server-15.5-1PGDG.rhel7.x86_64                                                                                                                                                                               2/2 Verifying  : postgresql15-contrib-15.5-1PGDG.rhel7.x86_64                                                                                                                                                                              1/2 Verifying  : postgresql15-server-15.5-1PGDG.rhel7.x86_64                                                                                                                                                                               2/2 Removed:postgresql15-server.x86_64 0:15.5-1PGDG.rhel7                                                                                                                                                                                              Dependency Removed:postgresql15-contrib.x86_64 0:15.5-1PGDG.rhel7                                                                                                                                                                                             Complete!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/diannao/63513.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

李飞飞的生成式3D场景,对数字孪生的未来影响几何?

大家好&#xff0c;我是日拱一卒的攻城师不浪&#xff0c;致力于技术与艺术的融合。这是2024年输出的第47/100篇文章。 前言 这两天&#xff0c;AI界的教母李飞飞团队重磅发布了空间智能生成式AI大模型。 仅通过一张图片就能够生成一个可操作和交互的3D空间场景。 空间智能的…

Redis面试专题-持久化

目录 前言 持久化相关知识 1.三种持久化机制 2.RDB持久化 3.深入剖析一下RDB持久化过程 4.AOF持久化 5.RDB和AOF对比​编辑 面试题 1.redis持久化机制有哪些&#xff1f; 2.那仔细讲讲你对他们的理解 3.你刚刚说AOF的文件很大&#xff0c;那AOF文件会越来越大&#xf…

数据结构之初始二叉树(1)

找往期文章包括但不限于本期文章中不懂的知识点&#xff1a; 个人主页&#xff1a;我要学编程(ಥ_ಥ)-CSDN博客 所属专栏&#xff1a;数据结构&#xff08;Java版&#xff09; 目录 树型结构 树的概念 与树的有关概念 树的表示形式 树的应用 二叉树 概念 两种特殊的…

酷柚易汛生产管理系统PHP+Uniapp

生产管理系统&#xff0c;帮助企业数字化转型&#xff0c;打造智能工厂&#xff0c;专业为生产企业量身开发的一套完整的生产管理系统。主要包含以下模块&#xff1a;购货模块、生产模块、仓库模块、资料模块&#xff0c;可配合酷柚易汛进销存无缝衔接使用。 产品理念: 共享功…

从零开始学TiDB(2)深入了解TiDB Server模块

TiDB Server 架构 TiDB Server 的主要功能&#xff1a; 一条SQL的执行流程&#xff1a; 1.将整个SQL语句解析成一个个的token&#xff0c;生成一个树形结构。 2.编译模块 1.首先需要做一个合法性验证&#xff0c;比如表存不存在等。 2.做逻辑优化&#xff1a;依据关系型代数等…

贪心算法专题(四)

目录 1. 单调递增的数字 1.1 算法原理 1.2 算法代码 2. 坏了的计算器 2.1 算法原理 2.2 算法代码 3. 合并区间 3.1 算法原理 3.2 算法代码 4. 无重叠区间 4.1 算法原理 4.2 算法代码 5. 用最少数量的箭引爆气球 5.1 算法原理 ​5.2 算法代码 1. 单调递增的数字…

241207-通过Docker部署Wiki.JS并设置ElasticSearch进行中文搜索

A. 最终效果 B. 配置文件 version: "3" services:wiki:image: ghcr.io/requarks/wiki:2container_name: wikijsports:- "3000:3000"volumes:- /home/lgk/Projects/WikiJS/config:/configenvironment:- DB_TYPEpostgres- DB_HOSTdatabase- DB_PORT5432- DB…

Spring Boot如何实现防盗链

一、什么是盗链 盗链是个什么操作&#xff0c;看一下百度给出的解释&#xff1a;盗链是指服务提供商自己不提供服务的内容&#xff0c;通过技术手段绕过其它有利益的最终用户界面&#xff08;如广告&#xff09;&#xff0c;直接在自己的网站上向最终用户提供其它服务提供商的…

springboot394疫情居家办公系统(论文+源码)_kaic

摘 要 如今社会上各行各业&#xff0c;都喜欢用自己行业的专属软件工作&#xff0c;互联网发展到这个时候&#xff0c;人们已经发现离不开了互联网。新技术的产生&#xff0c;往往能解决一些老技术的弊端问题。因为传统疫情居家办公系统信息管理难度大&#xff0c;容错率低&a…

RabbitMQ七种工作模式之 RPC通信模式, 发布确认模式

文章目录 六. RPC(RPC通信模式)客户端服务端 七. Publisher Confirms(发布确认模式)1. Publishing Messages Individually(单独确认)2. Publishing Messages in Batches(批量确认)3. Handling Publisher Confirms Asynchronously(异步确认) 六. RPC(RPC通信模式) 客⼾端发送消息…

模型训练数据-MinerU一款Pdf转Markdown软件

模型训练数据-MinerU一款Pdf转Markdown软件-说明 简介&#xff1a; MinerU是什么 MinerU是上海人工智能实验室OpenDataLab团队推出的开源智能数据提取工具&#xff0c;专注于复杂PDF文档的高效解析与提取。MinerU能将包含图片、公式、表格等元素的多模态PDF文档转化为易于分析…

STM32F103 PWM配置

在《STM32F103定时器配置》中我们介绍了PWM的产生原理&#xff0c;本节介绍介绍如何编码实现PWM的输出。 一、PWM相关寄存器 TIMx如果要产生PWM&#xff0c;除了我们上一节提到的如下寄存器&#xff1a; 控制寄存器(TIMx_CR1)&#xff1b;DMA/中断使能寄存器(TIMx_DIER)&#x…

Flink Python作业快速入门

Flink Python快速入门_实时计算 Flink版(Flink)-阿里云帮助中心 import argparse # 用于处理命令行参数和选项&#xff0c;使程序能够接收用户通过命令行传递的参数 import logging import sysfrom pyflink.common import WatermarkStrategy, Encoder, Types from pyflink.data…

三菱CNC数采超详细,资料全备教程,后续更新发那科数采教程

三菱数采详细教程 文章目录 三菱数采详细教程一、介绍1.背景2.需要掌握知识3.需要资料①三菱SDK包&#xff1a;A2②三菱com接口文档③C#代码&#xff1a;④VStudio⑤资料存放网盘 二、程序运行1.调试设备①条件②命令 2.运行软件①打开软件②运行程序 三、数据采集1.代码了解2.…

常见限流算法详细解析

常见限流算法详细解析 分布式系统中&#xff0c;由于接口API无法控制上游调用方的行为&#xff0c;因此当瞬时请求量突增时&#xff0c;会导致服务器占用过多资源&#xff0c;发生响应速度降低、超时、乃至宕机&#xff0c;甚至引发雪崩造成整个系统不可用。 限流&#xff0c;…

java+ssm+mysql高校学籍管理系统

项目介绍&#xff1a; 使用javassmmysql开发的高校学籍管理系统&#xff0c;系统包含超级管理员&#xff0c;系统管理员、教师、学生角色&#xff0c;功能如下&#xff1a; 超级管理员&#xff1a;管理员管理&#xff08;可以新增管理员&#xff09;&#xff1b;专业管理&…

(5)JS-Clipper2之PolyNode

1. 描述 PolyNodes是被封装在PolyTree的容器中&#xff0c;同时提供了一个数据结构来代表由Excute()方法返回的多边形轮廓中的父子关系。 一个PolyNode对象代表一个多边形&#xff1b;它的“IsHole”属性表明它是一个“外轮廓”还是一个“内孔”&#xff0c;PolyNodes可能包含…

Java项目实战II基于微信小程序的无中介租房系统(开发文档+数据库+源码)

目录 一、前言 二、技术介绍 三、系统实现 四、核心代码 五、源码获取 全栈码农以及毕业设计实战开发&#xff0c;CSDN平台Java领域新星创作者&#xff0c;专注于大学生项目实战开发、讲解和毕业答疑辅导。 一、前言 随着城市化进程的加速&#xff0c;租房市场日益繁荣&a…

MATLAB稀疏感知图像和体数据恢复的系统对象研究

稀疏感知图像和体数据恢复是一种用于恢复损坏、噪声或不完整的图像和体数据的技术。它利用了信号的稀疏性&#xff0c;即信号在某种基础下可以用较少的非零系数表示&#xff0c;从而实现高质量的恢复。 在进行稀疏感知图像和体数据恢复的研究时&#xff0c;需要定义一些系统对…

安卓调试环境搭建

前言 前段时间电脑重装了系统&#xff0c;最近准备调试一个apk&#xff0c;没想到装环境的过程并不顺利&#xff0c;很让人火大&#xff0c;于是记录一下。 反编译工具下载 下载apktool.bat和apktool.jar 官网地址&#xff1a;https://ibotpeaches.github.io/Apktool/install…