如何查看postgresql中function()的定义或sql代码?

时间:2019-02-25 02:23:45

标签: sql postgresql

我正在学习postgresql。

我创建了一个函数,该函数可以正常运行。但是,我确实很难回过头来查看sql代码。

您介意帮助我找到解决方案吗?

1 个答案:

答案 0 :(得分:1)

您可以使用the pg_proc catalogue

select proname, prosrc from pg_proc where proname= 'my_function';

或者在psql终端上,使用the \sf command

\sf my_function