From: Joe Conway Date: Sun, 17 Feb 2019 18:14:29 +0000 (-0500) Subject: Fix documentation for dblink_error_message() return value X-Git-Tag: REL9_4_22~51 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=64f6a65a00b0b6d768fc3fc49047524f4f99a54d;p=postgresql.git Fix documentation for dblink_error_message() return value The dblink documentation claims that an empty string is returned if there has been no error, however OK is actually returned in that case. Also, clarify that an async error may not be seen unless dblink_is_busy() or dblink_get_result() have been called first. Backpatch to all supported branches. Reported-by: realyota Backpatch-through: 9.4 Discussion: https://postgr.es/m/153371978486.1298.2091761143788088262@wrigleys.postgresql.org --- diff --git a/doc/src/sgml/dblink.sgml b/doc/src/sgml/dblink.sgml index d059f45599d..53396ea174e 100644 --- a/doc/src/sgml/dblink.sgml +++ b/doc/src/sgml/dblink.sgml @@ -1165,11 +1165,25 @@ dblink_error_message(text connname) returns text Return Value - Returns last error message, or an empty string if there has been + Returns last error message, or OK if there has been no error in this connection. + + Notes + + + 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. + + + Examples