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
评论