简体   繁体   English

如何在PostgreSQL PG-ADMIN中使用调试器?

[英]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? 是否有任何补助金或任何其他程序?

debugImage

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: 一些其他注意事项:

  • As mentioned above, you can only debug when running as a super user account 如上所述,您只能在以超级用户帐户身份运行时进行调试
  • From their docs you can only debug pl/pgsql functions. 他们的文档中,您只能调试pl / pgsql函数。 So if your function says something like 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.

相关问题 Postgresql 性能:使用 pg_timezone_names 的最佳方式是什么? - Postgresql Performance: What Is the Best Way to Use pg_timezone_names? PostgreSQL 是否在内部使用 pg_largeobject 表? - Does PostgreSQL use pg_largeobject table internally? 如何在pg_prepare()pg_execute()中使用参数ORDER BY? - How to use parametric ORDER BY with pg_prepare() pg_execute()? 我正在尝试更新PostgreSQL 9.6和pg admin 4上的表,并且没有更新/插入 - I am trying to update a table on postgreSQL 9.6 and pg admin 4 and it is not updating/inserting 如何在PostgreSQL中显示来自pg_stat_activity的不收听*查询 - How to show unlisten * query from pg_stat_activity in postgresql PostgreSQL 如何将 arrays 的 JSONB 数组转换为 arrays 的 pg 数组? - PostgreSQL How to convert JSONB array of arrays to pg array of arrays? PostgreSQL:如何在PostgreSQL中使用“交叉表”? - Postgresql: How to use “crosstab” in postgresql? PostgreSQL如何与as一起使用 - PostgreSQL how to use with as 如何使用扩展名pg_trgm中的%运算符? - How to use % operator from the extension pg_trgm? 如何在PG :: prepare中使用ST_GeomFromText? (红宝石) - How to use ST_GeomFromText with PG::prepare? (Ruby)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM