How to debug postgresql stored procedures?

后端 未结 3 1258
梦毁少年i
梦毁少年i 2020-12-23 16:33

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

The only question is how to

3条回答
  •  情书的邮戳
    2020-12-23 17:24

    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

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

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

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

提交回复
热议问题