How to display the function, procedure, triggers source code in postgresql?

后端 未结 8 636
别那么骄傲
别那么骄傲 2020-12-04 05:59

How to print functions and triggers sourcecode in postgresql? please let me know if any one know the query to display the function, triggers source code.

8条回答
  •  孤城傲影
    2020-12-04 06:23

    \sf function_name in psql yields editable source code of a single function.

    From https://www.postgresql.org/docs/9.6/static/app-psql.html:

    \sf[+] function_description This command fetches and shows the definition of the named function, in the form of a CREATE OR REPLACE FUNCTION command.

    If + is appended to the command name, then the output lines are numbered, with the first line of the function body being line 1.

提交回复
热议问题