aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorJoe Conway <mail@joeconway.com>2019-02-17 13:14:39 -0500
committerJoe Conway <mail@joeconway.com>2019-02-17 13:17:19 -0500
commit916b50a5ae0a7a64ca3b2497ccb1b97ce72f8aa9 (patch)
tree62d60d7690a2c40f92e03e52809068da2bb919cb /doc/src
parent0b476cf623dd5849679d4509f6b06b8be7f3436e (diff)
downloadpostgresql-916b50a5ae0a7a64ca3b2497ccb1b97ce72f8aa9.tar.gz
postgresql-916b50a5ae0a7a64ca3b2497ccb1b97ce72f8aa9.zip
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
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/dblink.sgml16
1 files changed, 15 insertions, 1 deletions
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,12 +1165,26 @@ dblink_error_message(text connname) returns text
<title>Return Value</title>
<para>
- Returns last error message, or an empty string if there has been
+ Returns last error message, or <literal>OK</literal> if there has been
no error in this connection.
</para>
</refsect1>
<refsect1>
+ <title>Notes</title>
+
+ <para>
+ When asynchronous queries are initiated by
+ <function>dblink_send_query</function>, the error message associated with
+ the connection might not get updated until the server's response message
+ is consumed. This typically means that <function>dblink_is_busy</function>
+ or <function>dblink_get_result</function> should be called prior to
+ <function>dblink_error_message</function>, so that any error generated by
+ the asynchronous query will be visible.
+ </para>
+ </refsect1>
+
+ <refsect1>
<title>Examples</title>
<programlisting>