Skip to content

Commit d5873b6

Browse files
committed
Document that PQexec() can handle a NULL res pointer just fine.
Backpatch to 9.1. Mark Hills
1 parent 2e02280 commit d5873b6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

doc/src/sgml/libpq.sgml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
return a non-null object pointer, unless perhaps there is too
6363
little memory even to allocate the <structname>PGconn</> object.
6464
The <function>PQstatus</> function should be called to check
65-
whether a connection was successfully made before queries are sent
65+
the return value for a successful connection before queries are sent
6666
via the connection object.
6767

6868
<warning>
@@ -1754,8 +1754,10 @@ PGresult *PQexec(PGconn *conn, const char *command);
17541754
Returns a <structname>PGresult</structname> pointer or possibly a null
17551755
pointer. A non-null pointer will generally be returned except in
17561756
out-of-memory conditions or serious errors such as inability to send
1757-
the command to the server. If a null pointer is returned, it should
1758-
be treated like a <symbol>PGRES_FATAL_ERROR</symbol> result. Use
1757+
the command to the server. The <function>PQresultStatus</> function
1758+
should be called to check the return value for any errors (including
1759+
the value of a null pointer, in which case it will return
1760+
<symbol>PGRES_FATAL_ERROR</symbol>). Use
17591761
<function>PQerrorMessage</function> to get more information about such
17601762
errors.
17611763
</para>

0 commit comments

Comments
 (0)