[英]How to use Debugger in PostgreSQL PG-ADMIN?
I was used Oracle SQL developer in that debugger is worked fine after Grant Debugger
but I am now using PostgreSQL PG-ADMIN and I am trying to use debug function but debug is not work. 我曾经使用过Oracle SQL Developer,因为在Grant Debugger
之后该调试器可以正常工作,但是我现在使用的是PostgreSQL PG-ADMIN,并且我尝试使用调试功能,但是debug无法正常工作。
Is there any grant or any other procedure? 是否有任何补助金或任何其他程序?
I also refer: 我也参考:
Debug PostgreSQL function using pgAdmin 使用pgAdmin调试PostgreSQL函数
You have to enable debugging in two places. 您必须在两个地方启用调试。 On PGAdmin and on the database itself. 在PGAdmin和数据库本身上。 That article you referenced does a wonderful job explaining it but there were some nuances. 您引用的那篇文章在解释它方面做得很好,但是有些细微差别。
PGAdmin pgAdmin的
When updating your postgresql.conf
file to load the debugging library, I was running PGAdmin on Windows so the file was here: 更新您的postgresql.conf
文件以加载调试库时,我在Windows上运行PGAdmin,因此文件位于此处:
C:\Program Files\PostgreSQL\9.4\data\postgresql.conf
And the path to the plugin_debugger.dll
was actually 而plugin_debugger.dll
的路径实际上是
$libdir/plugin_debugger.dll
not 不
$libdir/plugins/plugin_debugger.dll
as specified in the article. 如文章中所指定。 So your postgresql.conf
would need a line like this 所以你的postgresql.conf
需要这样的一行
shared_preload_libraries = '$libdir/plugin_debugger.dll'
Search for the actual .dll if you're in doubt. 如有疑问,请搜索实际的.dll。 If you're on Linux the file you'll be looking for is plugin_debugger.so
. 如果您使用的是Linux, plugin_debugger.so
查找的文件是plugin_debugger.so
。 Don't forget that changing the postgresql.conf
file will require a restart for the change to take effect. 不要忘记更改postgresql.conf
文件将需要重新启动才能使更改生效。
PostgreSQL Database PostgreSQL数据库
Assuming you're running your PostgreSQL database on a Linux server this gist does an excellent job at explaining how to download the dependencies for enabling debugging. 假设您要在Linux服务器上运行PostgreSQL数据库, 这个要点在解释如何下载依赖项以启用调试方面做得很好。 Make sure you're running as root when you install. 确保在安装时以root用户身份运行。
The part that's easy to miss is issuing the command against the actual database you want to debug. 容易错过的部分是针对要调试的实际数据库发出命令。 For newer versions on PostgreSQL all you'll need to do is this: 对于PostgreSQL上的较新版本,您需要做的是:
CREATE EXTENSION IF NOT EXISTS pldbgapi;
If that doesn't return an error, you should be good to go. 如果那没有返回错误,那么您应该一切顺利。
Some additional things of note: 一些其他注意事项:
LANGUAGE c
PGAdmin won't even show a right-click Debug menu option when you select the function. 因此,如果您的函数说的是LANGUAGE c
PGAdmin之类的内容,选择该函数时甚至不会显示右键单击“调试”菜单选项。 Look for something that has LANGUAGE plpgsql
and the Debug menu should show. 查找具有LANGUAGE plpgsql
并且应显示“调试”菜单。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.