11之前使用pg,我一般linux下使用二进制版本,window下使用解压版本,不管是解压版还是二进制版,小版本的升级都是分钟级内,非常方便,没做过源码安装的升级,今天测一下源码方式的小版本升级,由12.0升级至12.1
1.安装pg12.0
[postgres@localhost ~]$ tar zxvf postgresql-12.0.tar.gz [postgres@localhost ~]$ cd postgresql-12.0/ [postgres@localhost postgresql-12.0]$ ./configure --prefix=/home/postgres/pg12 --with-pgport=6001 --without-zlib [postgres@localhost postgresql-12.0]$ make && make install [postgres@localhost postgresql-12.0]$ /home/postgres/pg12/bin/initdb -D/home/postgres/data6001 -Upostgres [postgres@localhost postgresql-12.0]$ cd ~ [postgres@localhost ~]$ /home/postgres/pg12/bin/pg_ctl -D /home/postgres/data6001 -l logfile start
复制
2.创建扩展oracle_fdw和测试表t1
没用过oracle_fdw的可以参考我下面这篇文章:https://www.modb.pro/db/12878
PostgreSQL外部表插件oracle_fdw
[postgres@localhost oracle_fdw-master]$ psql -p6001 -Upostgres psql (12.0) Type "help" for help. postgres=# create extension oracle_fdw; CREATE EXTENSION postgres=# select oracle_diag(); oracle_diag ------------------------------------------------------------------ oracle_fdw 2.2.1devel, PostgreSQL 12.0, Oracle client 11.2.0.4.0 (1 row) postgres=# create table t1 (id int ,info text); CREATE TABLE postgres=# insert into t1 values(100,now()); INSERT 0 1 postgres=# select * from t1; id | info -----+------------------------------- 100 | 2019-12-31 09:32:16.675456+08 (1 row) postgres=# \q
复制
3.停pg12.0并编译12.1
[postgres@localhost oracle_fdw-master]$ cd ~ [postgres@localhost ~]$ /home/postgres/pg12/bin/pg_ctl -D /home/postgres/data6001 -l logfile stop [postgres@localhost ~]$ tar zxvf postgresql-12.1.tar.gz [postgres@localhost ~]$ cd postgresql-12.1/ [postgres@localhost postgresql-12.1]$ ./configure --prefix=/home/postgres/pg12 --with-pgport=6001 --without-zlib [postgres@localhost postgresql-12.1]$ make && make install [postgres@localhost postgresql-12.1]$ cd ~
复制
4.启动12.1并测试
[postgres@localhost ~]$ /home/postgres/pg12/bin/pg_ctl -D /home/postgres/data6001 -l logfile start [postgres@localhost ~]$ psql -p6001 -Upostgres psql (12.1) Type "help" for help. postgres=# \dx List of installed extensions Name | Version | Schema | Description ------------+---------+------------+---------------------------------------- oracle_fdw | 1.1 | public | foreign data wrapper for Oracle access plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language (2 rows) postgres=# select oracle_diag(); oracle_diag ------------------------------------------------------------------ oracle_fdw 2.2.1devel, PostgreSQL 12.1, Oracle client 11.2.0.4.0 (1 row) postgres=# select * from t1; id | info -----+------------------------------- 100 | 2019-12-31 09:32:16.675456+08 (1 row)
复制
可以看到旧版本安装的插件也继承过来了,实验成功。
最后修改时间:2020-01-20 14:35:22
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
文章被以下合辑收录
评论
相关阅读
外国CTO也感兴趣的开源数据库项目——openHalo
小满未满、
1917次阅读
2025-04-21 16:58:09
3月“墨力原创作者计划”获奖名单公布
墨天轮编辑部
381次阅读
2025-04-15 14:48:05
转发有奖 | PostgreSQL 16 PGCM高级认证课程直播班招生中!
墨天轮小教习
196次阅读
2025-04-14 15:58:34
中国PostgreSQL培训认证体系新增PGAI应用工程师方向
开源软件联盟PostgreSQL分会
189次阅读
2025-05-06 10:21:13
4月“墨力原创作者计划”获奖名单公布!
墨天轮编辑部
171次阅读
2025-05-13 16:21:59
华象新闻 | PostgreSQL 18 Beta 1、17.5、16.9、15.13、14.18、13.21 发布
严少安
169次阅读
2025-05-09 11:34:10
PG生态赢得资本市场青睐:Databricks收购Neon,Supabase融资两亿美元,微软财报点名PG
老冯云数
151次阅读
2025-05-07 10:06:22
SQL 优化之 OR 子句改写
xiongcc
146次阅读
2025-04-21 00:08:06
QPlus V6.3 更新,新增PostgreSQL与PolarDB PG支持,OceanBase 容灾管理重磅上线
沃趣科技
137次阅读
2025-05-13 09:39:27
告别老旧mysql_fdw,升级正当时
NickYoung
127次阅读
2025-04-29 11:15:18