随笔 - 136, 文章 - 0, 评论 - 14, 阅读 - 13万
  首页  :: 新随笔  :: 管理
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

PostgreSQL 9.6.0更新补丁到9.6.24

Posted on   高&玉  阅读(848)  评论(0编辑  收藏  举报

背景

  生产环境安扫,PostgreSQL数据库扫出来一堆漏洞。目前我们线上PostgreSQL数据库版本大部分是9.6.0,PostgreSQL官方9.6最新补丁是9.6.24。

升级步骤

下载PostgreSQL 9.6.24

[root]# wget --no-check-certificate https://ftp.postgresql.org/pub/source/v9.6.24/postgresql-9.6.24.tar.gz

 

1. 升级前版本查看

postgres=# select version();
                                                 version                                                  
----------------------------------------------------------------------------------------------------------
 PostgreSQL 9.6.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit

 

2. 源码安装PostgreSQL 9.6.24

[root]# tar -zxf postgresql-9.6.24.tar.gz
[root]# cd /root/postgresql-9.6.24
[root]# ./configure --prefix=/usr/local/postgresql-9.6.24 --with-perl --with-python --enable-thread-safety --with-uuid=ossp --with-wal-segsize=64
[root]# make && make install

 

3. 安装contrib工具

[root]# cd /root/postgresql-9.6.24/contrib
[root]# make && make install

 

4. 关闭postgres

[postgres]# pg_ctl stop 

 

5. 替换补丁包

[root]# rm -fr /usr/local/postgresql
[root]# ln -s /usr/local/postgresql-9.6.24 /usr/local/postgresql
[root]# chown -R postgres:postgres /usr/local/postgresql-9.6.24
[root]# chown -R postgres:postgres /usr/local/postgresql

 

6. 启动postgres

[postgres]# pg_ctl start

 

7. 升级后查看数据库版本

postgres=# select version();
                                                  version                                                  
-----------------------------------------------------------------------------------------------------------
 PostgreSQL 9.6.24 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44), 64-bit

 

至此补丁更新完毕。

相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 记一次.NET内存居高不下排查解决与启示
点击右上角即可分享
微信分享提示