繁体   English   中英

如何从 postgresql 中的引发异常中排除上下文

[英]How to exclude context from raise exception in postgresql

我想在 function postgresql中抛出错误,但是如果我想从中排除/删除上下文错误怎么办?

到目前为止我尝试了什么

RAISE 'messages error here (%) and here', NEW.request
      USING HINT = 'hint messages here';

我收到返回message errorhintcontext ..

SQLSTATE[P0001]: 引发异常: 7 错误: 消息错误在这里 (var) 和这里\n提示: 提示消息在这里\nCONTEXT: PL/pgSQL functionapproval_list_fnc_status() line 23 at RAISE (SQL: update "table" set "field1" = value1, "field2" = value2 其中 "id" = 9528ac4b-e20f-4be4-b251-42f0e28df9a9)"

如果我想从错误中排除context怎么办?

上下文信息始终存在,但错误消息的所有属性(详细信息、提示、上下文...)都是独立的,您的客户端代码只能使用您感兴趣的那些。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM