随记:近期,由于需要使用postgresql(PG)数据库的存储过程,需要对存储过程或者函数进行调试,因此百度了一下,发现基本上都是去(git://git.postgresql.org/git/pldebugger.git)下载调试插件或者前往GitHub下载调试插件然后编译,过程比较繁琐,最后发现,其实高版本的pg已经自带调试插件。具体步骤如下(以windows为例)
1.从EnterpriseDB下载postgresql数据库,按照正常步骤进行安装即可.
2. 编辑postgresql.conf文件
- linux 操作系统:
shared_preload_libraries = '$libdir/plugin_debugger.so'
- windows操作系统:
shared_preload_libraries = '$libdir/plugin_debugger.dll'
3. 重启Postgresql服务实例
4. 在数据库中创建pldbapi拓展并保存,然后你就可以使用调试工具了。