如何调试postgresql存储过程? [英] How to debug postgresql stored procedures?

查看:334
本文介绍了如何调试postgresql存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我意识到没有什么类似于SQL Server Management Studio的东西,因此我已经做好了使用旧的printf调试的心理准备。

I realize that there is nothing similar to SQL Server Management Studio, so I am mentally prepared to use the good old printf debugging.

唯一的问题是如何

推荐答案

要打印消息,可以使用从PL / pgSQL函数中发出通知

http://www.postgresql.org/docs/current/static/plpgsql-errors-and-messages.html

To "print" a message, you can use raise notice from within a PL/pgSQL function:
http://www.postgresql.org/docs/current/static/plpgsql-errors-and-messages.html

请注意,客户端必须将 c​​lient_min_messages的值设置为适当的级别才能接收通知。

Note that the client must have set the value of "client_min_messages" to the appropriate level in order to receive the "notice".

pgAdmin具有功能调试器:< a href = http://www.pgadmin.org/docs/1.18/debugger.html> http://www.pgadmin.org/docs/1.18/debugger.html

pgAdmin has a debugger for functions: http://www.pgadmin.org/docs/1.18/debugger.html

(但是我从未使用过,因为我不使用pgAdmin)。

(But I have never use it as I don't use pgAdmin).

这篇关于如何调试postgresql存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆