Postgresql 中文操作指南
dblink_error_message
dblink_error_message — 获取指定连接上的最后一个错误消息
dblink_error_message — gets last error message on the named connection
Description
dblink_error_message 获取给定连接的最新远程错误消息。
dblink_error_message fetches the most recent remote error message for a given connection.
Return Value
返回上次错误消息,或者如果在此连接中没有错误,则返回 OK 。
Returns last error message, or OK if there has been no error in this connection.
Notes
当 dblink_send_query 启动异步查询时,与连接关联的错误消息可能在消耗掉服务器的响应消息之前不会更新。这通常意味着 dblink_is_busy 或 dblink_get_result 应该在 dblink_error_message 之前调用,以便可以看到异步查询生成的任何错误。
When asynchronous queries are initiated by dblink_send_query, the error message associated with the connection might not get updated until the server’s response message is consumed. This typically means that dblink_is_busy or dblink_get_result should be called prior to dblink_error_message, so that any error generated by the asynchronous query will be visible.