上传 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 -l
drwxr-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.c
src/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.c
src/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 preload
shared_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$ psqlcreate database testdb;\l\c testdbselect name,default_version,installed_versionfrom pg_available_extensionswhere 1=1order by name;create extension amqp;select *from pg_extension;

参考:
https://github.com/omniti-labs/pg_amqp
https://pgxn.org/dist/pg_amqp/
http://blog.163.com/digoal@126/blog/static/16387704020120182524830

备注:
在 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

centos 7.4 + postgresql 10.1 + pg_amqp相关推荐

  1. CentOS 8 安装 PostgreSQL 10

    首先进入 PostgreSQL 官网,选择当前系统及版本,就能得到下面第一步中的安装语句.其实命令和之前的差别不大,主要是使用了 dnf ,所以选择对应的版本后就可以愉快的开始安装了. 一.安装 Po ...

  2. Centos 7 安装 PostgreSQL

    本文只讲PostgreSQL在CentOS 7.x 下的安装,其他系统请查看:https://www.postgresql.org/download PostgreSQL 所用版本为:PostgreS ...

  3. 2亿数据量PostgreSQL 10.4查询调优思路分享

    目录 ●背景 ●使用物理服务器 ●增加内存大小 ●使用NVMe协议的固态硬盘 ●将数据库安装在内存 ●业务调整 ●修改默认配置项 ●启用Gin (Generalized Inverted Index) ...

  4. PostgreSQL 10.0 preview 功能增强 - 后台运行(pg_background)

    标签 PostgreSQL , 10.0 , 后台运行 , pg_background_launch , pg_background_result , pg_background_detach , p ...

  5. postgresql 10.1 分区表之 list 分区

    查看数据库版本 select version(); PostgreSQL 10.1 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 201203 ...

  6. 阿里云推PostgreSQL 10 高可用版

    2015年,阿里云宣布正式推出RDS for PostgreSQL服务,届时,阿里云成为国内首家同时支持MySQL.SQL Server 和PostgreSQL关系型数据库的云计算服务商. 用户在云上 ...

  7. 重磅发布!阿里云推PostgreSQL 10 高可用版

    2015年,阿里云宣布正式推出RDS for PostgreSQL服务,届时,阿里云成为国内首家同时支持MySQL.SQL Server 和PostgreSQL关系型数据库的云计算服务商. 用户在云上 ...

  8. pg10 10.3 1 linux64,Install Postgresql 10 In Ubutnu 16.04 LTS

    PostgreSQL数据库是一个高性能的全功能的开源关系型数据库,这里讲解一下如何在Ubuntu 16.04 LTS 下安装 PostgreSQL 10. 添加软件源 wget -q -O - htt ...

  9. “王者对战”之 MySQL 8 vs PostgreSQL 10

    本文是对两大开源关系型数据库MySQL.PostgreSQL做了详细的对比,欢迎大家在评论区发表自己的见解. 在这些版本之前,人们普遍认为,Postgres 在功能集表现更出色,也因其"学院 ...

最新文章

  1. Spark With Mongodb 实现方法及error code -5, 6, 13127解决方案
  2. Anaconda中快速安装Tensorflow与Keras并在pycharm中完成相应配置(win10cpu版)
  3. 笔记本在Win7下使用wubi安装Ubuntu10.04 双系统
  4. tomcat8源码分析-Connector初始化
  5. WebKit 布局的标准和概念
  6. BZOJ4590: [Shoi2015]自动刷题机
  7. 前端学习(3005):vue+element今日头条管理--处理布局完成
  8. Fetch发送网络请求
  9. [转载]名字长的麻烦
  10. 批量处理文件,正则表达式处理文件
  11. python画柱状图-Python画柱状统计图操作示例【基于matplotlib库】
  12. Windows域的创建与加入教程
  13. linux oel7没有网络,sudo su命令不在OEL 7中工作(sudo su command not working in OEL 7)
  14. Minicom安装和使用和lte调试方法
  15. mc服务器ip是网站,我的世界服务器地址大全
  16. 《像神一样玩转金融》公益免费课持续分享!
  17. 面向对象程序设计c++版董正言张聪课本课后习题答案第三章
  18. JS 浮点数转整数的方法
  19. 郑州大学计算机硕士分数线,2021郑州大学考研复试线:热门专业超过400分,机械类专业仅263分...
  20. javascript 判断当前浏览器版本

热门文章

  1. 说说Java 7中的模块系统基本概念
  2. LeetCode 5352. 生成每种字符都是奇数个的字符串
  3. ModuleNotFoundError: No module named 'tensorflow.python.saved_model.model_utils'
  4. linux命令行安装vnc_CentOS下安装VNC并设置远程服务
  5. ArcMap 导入 wrl_ai文件导入c4d没反应怎么办? c4d导入ai源文件失败的原因分析_Illustrator教程_平面设计...
  6. centos 编译安装 mysql_CentOS7编译安装MySQL5.7.24的教程详解
  7. 【NeurIPS2020】Google点针图网络,Pointer Graph Networks
  8. kaggle实战笔记_1.数据处理
  9. 软件架构设计——软件架构风格
  10. Aave 上线 AMM Market,允许 Uniswap 和 Balancer 的流动性提供商使用 LP 代币作为抵押品