diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 174a6b7f37b..875950b83c0 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -5760,15 +5760,32 @@ typedef struct PQfn always returns a valid - PGresult pointer. The result status should be + PGresult pointer, with + status PGRES_COMMAND_OK for success + or PGRES_FATAL_ERROR if some problem was encountered. + The result status should be checked before the result is used. The caller is responsible for freeing the PGresult with when it is no longer needed. - Note that it is not possible to handle null arguments, null results, - nor set-valued results when using this interface. + To pass a NULL argument to the function, set + the len field of that parameter structure + to -1; the isint + and u fields are then irrelevant. + + + + If the function returns NULL, *result_len is set + to -1, and *result_buf is not + modified. + + + + Note that it is not possible to handle set-valued results when using + this interface. Also, the function must be a plain function, not an + aggregate, window function, or procedure.