postgresql:pgadmin函数调试工具安装过程
通过安装第三方插件pldebugger,可实现在pgadmin客户端对函数设置断点、调试,具体过程如下:
1.下载pldebugger安装包:
http://git.postgresql.org/gitweb/ 所有第三方插件都可在此下载,此处下载pldebugger.git
2.拷贝安装
将下载好的压缩包(pldebugger-14c6caf.tar.gz)拷贝到postgresql安装目录contrib,
解压:
tar zxvf pldebugger-14c6caf.tar.gz
查看reademe文件,看安装要求:
Installation
------------
- Copy this directory to contrib/ in your PostgreSQL source tree.
- Run 'make; make install'
- Edit your postgresql.conf file, and modify the shared_preload_libraries config
option to look like:
shared_preload_libraries = '$libdir/plugin_debugger'
- Restart PostgreSQL for the new setting to take effect.
- Run the following command in the database or databases that you wish to
debug functions in:
CREATE EXTENSION pldbgapi;
(on server versions older than 9.1, you must instead run the pldbgapi--1.0.sql
script directly using psql).
按以上要求进行安装。
[root@localhost pldebugger-14c6caf]# make
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -fpic -I../../src/pl/plpgsql/src -I. -I. -I../../src/include -D_GNU_SOURCE -c -o plpgsql_debugger.o plpgsql_debugger.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -fpic -I. -I. -I../../src/include -D_GNU_SOURCE -c -o plugin_debugger.o plugin_debugger.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -fpic -I. -I. -I../../src/include -D_GNU_SOURCE -c -o dbgcomm.o dbgcomm.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -fpic -I. -I. -I../../src/include -D_GNU_SOURCE -c -o pldbgapi.o pldbgapi.c
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -fpic -shared -o plugin_debugger.so plpgsql_debugger.o plugin_debugger.o dbgcomm.o pldbgapi.o -L../../src/port -L../../src/common -Wl,--as-needed -Wl,-rpath,'/usr/local/pgsql9.5.0/lib',--enable-new-dtags
[root@localhost pldebugger-14c6caf]# make install
/bin/mkdir -p '/usr/local/pgsql9.5.0/lib'
/bin/mkdir -p '/usr/local/pgsql9.5.0/share/extension'
/bin/mkdir -p '/usr/local/pgsql9.5.0/share/extension'
/bin/mkdir -p '/usr/local/pgsql9.5.0/share/doc//extension'
/usr/bin/install -c -m 755 plugin_debugger.so '/usr/local/pgsql9.5.0/lib/plugin_debugger.so'
/usr/bin/install -c -m 644 ./pldbgapi.control '/usr/local/pgsql9.5.0/share/extension/'
/usr/bin/install -c -m 644 ./pldbgapi--1.0.sql ./pldbgapi--unpackaged--1.0.sql '/usr/local/pgsql9.5.0/share/extension/'
/usr/bin/install -c -m 644 ./README.pldebugger '/usr/local/pgsql9.5.0/share/doc//extension/'
可以看到,改插件被安装在postgresql目录的Lib文件中,查看lib目录可以看到:
-bash-4.1$ ll |grep debug
-rwxr-xr-x. 1 root root 62025 Mar 10 09:09 plugin_debugger.so
*此处注意在配置参数shared_preload_libraries = '$libdir/plugin_debugger'时,如果该参数有多个,只需加逗号即可,如
shared_preload_libraries = 'xxxxxx,$libdir/plugin_debugger'
安装
3.重启数据库,到需要进行函数调试数据库中执行CREATE EXTENSION pldbgapi;
注意:每次换一个库时,都要重新执行
经过以上过程,打开pgadmin,选择某个函数可以看到如下:
出现了调试功能,安装成功。
postgresql:pgadmin函数调试工具安装过程的更多相关文章
- android APK应用安装过程以及默认安装路径[转]
一:安装过程 APK是类似Symbian Sis或Sisx的文件格式.通过将APK文件直接传到Android模拟器或Android手机中执行即可安装. Android应用安装有如下四种方式 1. ...
- Android apk 的安装过程
Android应用安装有如下四种方式 1.系统应用安装――开机时完成,没有安装界面 2.网络下载应用安装――通过market应用完成,没有安装界面 3.ADB工具安装――没有安装界面. 4.第三方应用 ...
- Android中APK安装过程及原理解析
[原文] 来自华为内部资料 应用安装是智能机的主要特点,即用户可以把各种应用(如游戏等)安装到手机上,并可以对其进行卸载等管理操作.APK是Android Package的缩写,即android安装包 ...
- 19.CentOS7下PostgreSQL安装过程
CentOS7下PostgreSQL安装过程 装包 sudo yum install postgresql-server postgresql-contrib 说明: 这种方式直接明了,其他方法也可以 ...
- Postgresql ---plv8扩展(windows下安装过程)
Postgresql下plv8安装过程其实很简单,但是在网络上搜集了半天都没有找到一篇满意的安装文档,现在总结如下: 1.下载和PostgreSQL相对应的plv8版本,下载地址如下: http:// ...
- Mapnik 编译安装过程
首先总结一下,Linux(windows上没有测试过)上Mapnik的编译与测试就是一部心酸血泪史呀,如果您没有做好思想准备,那就出门左转,看点有意思的去吧,编译这个太煎熬了. 安装PostgreSQ ...
- PostgreSQL在win7上安装详细步骤
原文:PostgreSQL在win7上安装详细步骤 PostgreSQL安装: 一.windows下安装过程 安装介质:postgresql-9.1.3-1-windows.exe(46M),安装过程 ...
- Moses在Ubuntu14.04平台的安装过程
平台环境:在windows 7中建立VMware虚拟机,操作系统为Ubuntu_14.04_amd_64 1.安装GIZA++ 安装步骤如下: wget http://giza-pp.googleco ...
- postgresql数据库的yum安装方法
实验环境>>>>>>>>>>>>>>>>>>操作系统:CentOS release 6.3 ...
随机推荐
- Redis学习和环境搭建
基本的redis教程,搭建,可以参照下面任一教程: 地址一:http://www.yiibai.com/redis/redis_quick_guide.html 地址二:http://www.runo ...
- [bootsrap]模态框使用例
<a href="#modal1" role="button" class="btn btn-primary btn-sm" data ...
- 架构实例之Demo_JSP_JavaBean
架构实例之Demo_JSP_JavaBean 1.开发工具和开发环境 开发工具: MyEclipse10,JDK1.6.0_13(32位),Tomcat7.0(32位),mysql5.7.1 ...
- matlab里的svmtrain的输出model里,各参数的含义
Parameters: [5x1 double] %结构体变量,依次保存的是 -s -t -d -g -r等参数 nr_class: 4 %分类的个数 totalS ...
- NOI2001|POJ1182食物链[种类并查集 向量]
食物链 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 65430 Accepted: 19283 Description ...
- Hololens入门之语音识别(语音命令)
http://blog.csdn.net/sun_t89/article/details/52430923
- visual studio 2015中的webapi生成helpPage,页面不显示方法说明问题解决
环境: vs2015.win7 参考:http://www.cnblogs.com/Erik_Xu/p/5638381.html 生成的help页面如下:,并没有显示控制器和方法. 原因是:新建项目时 ...
- 关于把.net 2.0的项目升级到.net4.0遇到的一些问题
进入公司实习的的第一个项目又是是一个升级项目.这次升级的是一个c/s架构的项目. 大致介绍一下这个项目的结构客户端采用winform+devexpress商业控件开发的,数据库是用的oracle数据库 ...
- HMAC加密的消息摘要码
HMAC(Hash Message Authentication Code)哈希消息授权码,它在消息摘要算法(例如MD5,SHA系列算法)的基础上,使用密钥对消息摘要进行加密.它相当于一个马甲,内里可 ...
- 谈谈duilib
据我所知,duilib已经不再维护了,q群也不再对外开放了. 尽管不再更新,但duilib的学习价值还是很好的.当有一定基础后再扩展duilib的功能,或根据duilib学习到的知识去着手写自己的界面 ...