Get all notices of PostgreSQL's RAISE NOTICE

后端 未结 2 675
情书的邮戳
情书的邮戳 2020-12-21 05:43

I have big DB function which has multiple lines like this

RAISE NOTICE \'some step completed\';

I want to get all this notices in my PHP ap

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-21 06:38

    pg_last_notice() now accepts an optional parameter to specify an operation.

    This can be done with one of the following new constants:

    • PGSQL_NOTICE_LAST: to return last notice
    • PGSQL_NOTICE_ALL: to return all notices
    • PGSQL_NOTICE_CLEAR: to clear notices

    More info for Changed Functions in version 7.1 HERE.

提交回复
热议问题