有使用 postgres_fdw 插件吗? 不知道效率怎么样。
有使用 postgres_fdw 插件吗? 不知道效率怎么样。
我来答
添加附件
收藏
复制链接
微信扫码分享
在小程序上查看
分享
添加附件
问题补充
1条回答
默认
最新
postgres_fdw为访问远程表提供了更透明和符合标准的语法,并且在许多情况下可以提供更好的性能。
postgres_fdw 是PG源码包自带的插件,所以直接去源码包进行编译安装即可,这里需要注意的是,在编译的时候,最好是用postgres用户来执行操作
如下:
[postgres@WAhaha_PG_10 postgres_fdw]$ pwd
/opt/postgresql-10.6/contrib/postgres_fdw
[postgres@WAhaha_PG_10 postgres_fdw]$ ls
connection.c expected option.c postgres_fdw.c postgres_fdw.h sql
deparse.c Makefile postgres_fdw--1.0.sql postgres_fdw.control shippable.c
执行编译安装
[postgres@WAhaha_PG_10 postgres_fdw]$ USE_PGX=1 make install
make -C ../../src/interfaces/libpq all
make[1]: Entering directory `/opt/postgresql-10.6/src/interfaces/libpq'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/opt/postgresql-10.6/src/interfaces/libpq'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -I../../src/interfaces/libpq -I. -I. -I../../src/include -D_GNU_SOURCE -I/usr/include -c -o postgres_fdw.o postgres_fdw.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -I../../src/interfaces/libpq -I. -I. -I../../src/include -D_GNU_SOURCE -I/usr/include -c -o option.o option.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -I../../src/interfaces/libpq -I. -I. -I../../src/include -D_GNU_SOURCE -I/usr/include -c -o deparse.o deparse.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -I../../src/interfaces/libpq -I. -I. -I../../src/include -D_GNU_SOURCE -I/usr/include -c -o connection.o connection.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -I../../src/interfaces/libpq -I. -I. -I../../src/include -D_GNU_SOURCE -I/usr/include -c -o shippable.o shippable.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -fPIC -shared -o postgres_fdw.so postgres_fdw.o option.o deparse.o connection.o shippable.o -L../../src/port -L../../src/common -L../../src/interfaces/libpq -lpq -L/usr/lib64 -Wl,--as-needed -Wl,-rpath,'/usr/pgsql-8.4/lib',--enable-new-dtags
/usr/bin/mkdir -p '/usr/pgsql/lib'
/usr/bin/mkdir -p '/usr/pgsql/share/extension'
/usr/bin/mkdir -p '/usr/pgsql/share/extension'
/usr/bin/install -c -m 755 postgres_fdw.so '/usr/pgsql-8.4/lib/postgres_fdw.so'
/usr/bin/install -c -m 644 ./postgres_fdw.control '/usr/pgsql-8.4/share/extension/'
/usr/bin/install -c -m 644 ./postgres_fdw--1.0.sql '/usr/pgsql-8.4/share/extension/'
其实这个过程就是使用 pg_config 的环境,将编译好的 .so 文件拷贝到 lib 动态库中,.control文 件放在extension 文件中。
评论
有用 0回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
墨值悬赏


