博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
centos 7.4 + postgresql 10.1 + pg_amqp
阅读量:4697 次
发布时间:2019-06-09

本文共 3266 字,大约阅读时间需要 10 分钟。

上传 pg_amqp 到 /tmp 目录下

[root@tpg-1 tmp]# yum install lrzsz [root@tpg-1 tmp]# rz[root@tpg-1 tmp]# ls -l-rw-r--r--. 1 root root 48444 Dec 13 11:34 pg_amqp-0.3.0.zip[root@tpg-1 tmp]# unzip pg_amqp-0.3.0.zip[root@tpg-1 tmp]# ls -ldrwxr-xr-x. 5 root root   109 May 20  2011 pg_amqp-0.3.0-rw-r--r--. 1 root root 48444 Dec 13 11:34 pg_amqp-0.3.0.zip

开始编译

[root@tpg-1 tmp]# cd pg_amqp-0.3.0[root@tpg-1 tmp]# env LDFLAGS="-lpthread" gmakegcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -I. -I./ -I/usr/pgsql-10/include/server -I/usr/pgsql-10/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o src/pg_amqp.o src/pg_amqp.csrc/pg_amqp.c: In function ‘amqp_local_phase2’:src/pg_amqp.c:99:3: warning: enumeration value ‘XACT_EVENT_PARALLEL_COMMIT’ not handled in switch [-Wswitch]   switch(event) {   ^src/pg_amqp.c:99:3: warning: enumeration value ‘XACT_EVENT_PARALLEL_ABORT’ not handled in switch [-Wswitch]src/pg_amqp.c:99:3: warning: enumeration value ‘XACT_EVENT_PRE_COMMIT’ not handled in switch [-Wswitch]src/pg_amqp.c:99:3: warning: enumeration value ‘XACT_EVENT_PARALLEL_PRE_COMMIT’ not handled in switch [-Wswitch]src/pg_amqp.c:99:3: warning: enumeration value ‘XACT_EVENT_PRE_PREPARE’ not handled in switch [-Wswitch]gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -I. -I./ -I/usr/pgsql-10/include/server -I/usr/pgsql-10/include/internal  -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include  -c -o src/librabbitmq/amqp_debug.o src/librabbitmq/amqp_debug.csrc/librabbitmq/amqp_debug.c:44:6: warning: no previous prototype for ‘amqp_dump’ [-Wmissing-prototypes] void amqp_dump(void const *buffer, size_t len) {

存在一些警告,安装过程没有关注,貌似也没啥影响,pg_amqp.so可以正常使用

[root@tpg-1 tmp]# env LDFLAGS="-lpthread" gmake install

修改参数

-bash-4.2$ cat postgresql.conf |grep -i preloadshared_preload_libraries = 'pg_amqp.so'     # (change requires restart)

postgresql.conf 的其它参数值依据数据库的作用和机器配置设置

[root@tpg-1 ~]# systemctl status postgresql-10.service[root@tpg-1 ~]# systemctl start postgresql-10.service  -bash-4.2$ psql create database testdb; \l \c testdb select name,default_version,installed_version from pg_available_extensions where 1=1 order by name; create extension amqp; select * from pg_extension;

参考:

备注:

在 centos 7.4 + pgsql9.1 环境编译pg_amqp时,启动pgsql时报下错误,第一个通过德哥的文章解决了,第二步不知道什么原因导致的,先记录下
FATAL: could not load library “/usr/lib/postgresql/9.1/lib/src/pg_amqp.so”: /usr/lib/postgresql/9.1/lib/src/pg_amqp.so: undefined symbol: pthread_key_create

FATAL: could not load library “/usr/lib/postgresql/9.1/lib/src/pg_amqp.so”: /usr/lib/postgresql/9.1/lib/src/pg_amqp.so: undefined symbol: pthread_getspecific

转载于:https://www.cnblogs.com/ctypyb2002/p/9793089.html

你可能感兴趣的文章
黑马程序员 ExecuteReader执行查询
查看>>
记一些从数学和程序设计中体会到的思想
查看>>
题目1462:两船载物问题
查看>>
POJ 2378 Tree Cutting(树形DP,水)
查看>>
第二冲刺阶段个人博客5
查看>>
UVA 116 Unidirectional TSP (白书dp)
查看>>
第三方测速工具
查看>>
MySQL 网络访问连接
查看>>
在aws ec2上使用root用户登录
查看>>
数据访问 投票习题
查看>>
cnblog!i'm coming!
查看>>
使用点符号代替溢出的文本
查看>>
Axios 中文说明
查看>>
fatal: remote origin already exists.
查看>>
gridview 自定义value值
查看>>
2018二月实现计划成果及其三月规划
查看>>
类名.class和getClass()区别
查看>>
12/17面试题
查看>>
LeetCode 242. Valid Anagram
查看>>
JSP表单提交乱码
查看>>