我在哪里可以获得 pldbgapi.sql 以便为 postgresql 安装调试器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18534998/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Where can I get pldbgapi.sql in order to install the debugger for postgresql?
提问by Di Zou
I am trying to install the debugger for postgresql on Linux so I can use pgAdmin to debug my functions. I've set up my postgresql.conffile. However, I can't find pldbgapi.sql.
我正在尝试在 Linux 上为 postgresql 安装调试器,以便我可以使用 pgAdmin 来调试我的函数。我已经设置了我的postgresql.conf文件。但是,我找不到pldbgapi.sql。
Postgresql is installed at /usr/pgsql-9.2/. The directory /usr/pgsql-9.2/share/exists, but /usr/pgsql-9.2/share/contribdoes not exist. Where can I find the file or download it?
Postgresql 安装在/usr/pgsql-9.2/。目录/usr/pgsql-9.2/share/存在,但/usr/pgsql-9.2/share/contrib不存在。我在哪里可以找到该文件或下载它?
Thanks!
谢谢!
回答by JanHudecek
I've found out it works if I run the contents of this file
我发现如果我运行这个文件的内容它会起作用
share\extension\pldbgapi--1.0.sql
There is also this readme for the extension which mentions a different installation process, I haven't tried it
还有这个扩展名的自述文件提到了不同的安装过程,我没有尝试过
回答by VictorMartinez
Excelent aport, only:
优秀的港口,只有:
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;
Restart PostgreSQL for the new setting to take effect. Finally you can debugg!!
编辑您的 postgresql.conf 文件,并将 shared_preload_libraries 配置选项修改为:
shared_preload_libraries = '$libdir/plugin_debugger'
重新启动 PostgreSQL 以使新设置生效。
在要在其中调试函数的一个或多个数据库中运行以下命令:
创建扩展pldbgapi;
重新启动 PostgreSQL 以使新设置生效。终于可以调试了!!
I used in Postgres 9.4
我在 Postgres 9.4 中使用过
回答by shcherbak
This is included with EnterpriseDB distributive. You can download it on pgFoundry. here is a link
这包含在 EnterpriseDB 分发版中。您可以在 pgFoundry 上下载它。这是一个链接
Also git repo is available.
也可以使用 git repo。
git clone git://git.postgresql.org/git/pldebugger.git
cd pldebugger
export USE_PGXS=1
make
make install
Edit postgresql.conf
编辑 postgresql.conf
vim /path/to/postgresql.conf
add:
添加:
shared_preload_libraries = 'plugin_debugger'
Restart postgres, connect to db and call:
重新启动 postgres,连接到 db 并调用:
CREATE EXTENSION pldbgapi;
I use it on postgreql 9.5, works well.
我在 postgreql 9.5 上使用它,效果很好。