最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

PostgreSQL9.1.3plpgsqldebuggermodule

来源:动视网 责编:小采 时间:2020-11-09 11:20:31
文档

PostgreSQL9.1.3plpgsqldebuggermodule

PostgreSQL9.1.3plpgsqldebuggermodule:今天一位网友在群里面问PostgreSQL 9.0如何debug 函数. 我记得在8.3的时候有一个插件叫edb-debugger是可以使用的. 手头上没有9.0 今天一位网友在群里面问PostgreSQL 9.0如何debug 函数. 我记得在8.3的时候有一个插件叫edb-debugger是可以使
推荐度:
导读PostgreSQL9.1.3plpgsqldebuggermodule:今天一位网友在群里面问PostgreSQL 9.0如何debug 函数. 我记得在8.3的时候有一个插件叫edb-debugger是可以使用的. 手头上没有9.0 今天一位网友在群里面问PostgreSQL 9.0如何debug 函数. 我记得在8.3的时候有一个插件叫edb-debugger是可以使


今天一位网友在群里面问PostgreSQL 9.0如何debug 函数. 我记得在8.3的时候有一个插件叫edb-debugger是可以使用的. 手头上没有9.0

今天一位网友在群里面问PostgreSQL 9.0如何debug 函数. 我记得在8.3的时候有一个插件叫edb-debugger是可以使用的. 手头上没有9.0的数据库, 于是测试了一下在9.1上能不能用, 结果是编译不通过.

最后找到了解决办法, 记录如下.

在pgfoundry中有一个开源的edb-debugger插件可以用来调试PostgreSQL的PLPGSQL函数.

但是这个版本太老, 在PostgreSQL 9.1中无法编译通过, 报错如下.

make

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -fpic -I. -I. -I../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -c -o pldbgapi.o pldbgapi.c

pldbgapi.c: In function ‘pldbg_attach_to_port’:

pldbgapi.c:346: warning: implicit declaration of function ‘MAKE_OFFSET’

pldbgapi.c: In function ‘pldbg_wait_for_target’:

pldbgapi.c:474: warning: implicit declaration of function ‘SHM_OFFSET_VALID’

pldbgapi.c:476: warning: implicit declaration of function ‘MAKE_PTR’

pldbgapi.c:476: warning: cast to pointer from integer of different size

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -fpic -L../../src/port -Wl,-rpath,'/opt/pgsql/lib',--enable-new-dtags -shared -o pldbgapi.so pldbgapi.o

gcc -O2 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wformat-security -fno-strict-aliasing -fwrapv -fpic -I. -I. -I../../src/include -D_GNU_SOURCE -I/usr/include/libxml2 -c -o targetinfo.o targetinfo.c

targetinfo.c: In function ‘getTriggerFuncOid’:

targetinfo.c:268: error: ‘SnapshotNow’ undeclared (first use in this function)

targetinfo.c:268: error: (Each undeclared identifier is reported only once

targetinfo.c:268: error: for each function it appears in.)

targetinfo.c: In function ‘getProcOidBySig’:

targetinfo.c:508: error: too few arguments to function ‘FuncnameGetCandidates’

targetinfo.c: In function ‘getProcOidByName’:

targetinfo.c:555: error: too few arguments to function ‘FuncnameGetCandidates’

make: *** [targetinfo.o] Error 1

rm pldbgapi.o

不知道为什么不更新了, 作者是这两位.

在EDB发布的EDB-AS版本中是包含了debugger的.

只是直接把它的so文件拷贝到开源版本的PostgreSQL中无法使用.

例如我把EDB-AS 9.1.2.2版本的$libdir/plugins/plugin_debugger.so文件拷贝到开源的PostgreSQL $PGHOME/lib/plugins/目录下.

配置postgresql.conf

在启动数据库时报错如下 :

这个NonSPLFunctionContext在PostgresPlus/9.1AS/include/server/utils/elog.h 文件里面定义的.

但是把它拷贝到开源的PostgreSQL的/opt/pgsql/include/server/utils/elog.h后依旧.


虽然pgfoundry里面提供下载的只有0.9.3版本, 庆幸的是cvs里面有最新的.

请见参考链接, 把这些文件下载过了后放到源码的contrib目录里面新建一个debugger目录.

编译过程 :

make

make install

修改数据库配置文件 :

重启数据库,

在需要调试的数据库里面使用超级用户安装函数和类.

CREATE TYPE

CREATE TYPE

CREATE TYPE

CREATE TYPE

CREATE TYPE

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

CREATE FUNCTION

创建一个测试函数 :

使用pgAdmin登陆到这个数据库, 右键点击函数的时候就有调试选项了.


一个调试页面截图 :

文档

PostgreSQL9.1.3plpgsqldebuggermodule

PostgreSQL9.1.3plpgsqldebuggermodule:今天一位网友在群里面问PostgreSQL 9.0如何debug 函数. 我记得在8.3的时候有一个插件叫edb-debugger是可以使用的. 手头上没有9.0 今天一位网友在群里面问PostgreSQL 9.0如何debug 函数. 我记得在8.3的时候有一个插件叫edb-debugger是可以使
推荐度:
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top