首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在更新PostgreSQL后,在CentOS上没有更改版本

在更新PostgreSQL后,在CentOS上没有更改版本
EN

Database Administration用户
提问于 2018-02-08 16:08:08
回答 1查看 720关注 0票数 0

实际操作系统和PostgreSQL版本:

CentOS 7.3,PostgreSQL 10.1将更新为10.2。

步骤:

停止服务

代码语言:javascript
复制
/bin/systemctl stop postgresql-10.service

检查可用的包更新:

代码语言:javascript
复制
yum check-update
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.mirror.ca.planethoster.net
 * extras: muug.ca
 * updates: muug.ca

libgudev1.x86_64                                                                            219-42.el7_4.7                                                                        updates
pgdg-centos10.noarch                                                                        10-2                                                                                  pgdg10-updates-testing
systemd.x86_64                                                                              219-42.el7_4.7                                                                        updates
systemd-libs.x86_64                                                                         219-42.el7_4.7                                                                        updates
systemd-sysv.x86_64                                                                         219-42.el7_4.7                                                                        updates

更新PostgreSQL:

代码语言:javascript
复制
yum update pgdg-centos10.noarch
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirror2.evolution-host.com
     * extras: muug.ca
     * updates: muug.ca
    Resolving Dependencies
    --> Running transaction check
    ---> Package pgdg-centos10.noarch 0:10-1 will be updated
    ---> Package pgdg-centos10.noarch 0:10-2 will be an update
    --> Finished Dependency Resolution

    Dependencies Resolved

    ========================================================================================================================================================================================================
     Package                                           Arch                                       Version                                  Repository                                                  Size
    ========================================================================================================================================================================================================
    Updating:
     pgdg-centos10                                     noarch                                     10-2                                     pgdg10-updates-testing                                     4.6 k

    Transaction Summary
    ========================================================================================================================================================================================================
    Upgrade  1 Package

    Total download size: 4.6 k
    Is this ok [y/d/N]: y
    Downloading packages:
    Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
    pgdg-centos10-10-2.noarch.rpm                                                                                                                                                    | 4.6 kB  00:00:03
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      Updating   : pgdg-centos10-10-2.noarch                                                                                                                                                            1/2
      Cleanup    : pgdg-centos10-10-1.noarch                                                                                                                                                            2/2
      Verifying  : pgdg-centos10-10-2.noarch                                                                                                                                                            1/2
      Verifying  : pgdg-centos10-10-1.noarch                                                                                                                                                            2/2

    Updated:
      pgdg-centos10.noarch 0:10-2

    Complete!

重新启动服务:

代码语言:javascript
复制
/bin/systemctl start postgresql-10.service

检查版本:

代码语言:javascript
复制
psql -U myuser -d mydb -c "SELECT version()"
Password for user myuser:
                                                 version
---------------------------------------------------------------------------------------------------------
 PostgreSQL 10.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-16), 64-bit
(1 row)

还在10.1。有什么解释吗?

EN

回答 1

Database Administration用户

回答已采纳

发布于 2018-02-08 16:16:11

yum update pgdg-centos10.noarch只更新存储库定义。

要更新实际的Postgres二进制文件,需要使用

代码语言:javascript
复制
yum update postgresql10
票数 3
EN
页面原文内容由Database Administration提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://dba.stackexchange.com/questions/197405

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档