diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-03-08 13:35:28 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-03-08 13:35:28 -0400 |
commit | 1a0bc4c2bfc278b63965486b1525ad04a1f85989 (patch) | |
tree | e255bf25fc5b99c198c28696f5be979f98d57d40 /src | |
parent | 90c35a9ed06c1353a0d3818c259e629ff09dba18 (diff) | |
download | postgresql-1a0bc4c2bfc278b63965486b1525ad04a1f85989.tar.gz postgresql-1a0bc4c2bfc278b63965486b1525ad04a1f85989.zip |
Fix documentation for libpq's PQfn().
The SGML docs claimed that 1-byte integers could be sent or received with
the "isint" options, but no such behavior has ever been implemented in
pqGetInt() or pqPutInt(). The in-code documentation header for PQfn() was
even less in tune with reality, and the code itself used parameter names
matching neither the SGML docs nor its libpq-fe.h declaration. Do a bit
of additional wordsmithing on the SGML docs while at it.
Since the business about 1-byte integers is a clear documentation bug,
back-patch to all supported branches.
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/libpq/fe-exec.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/interfaces/libpq/fe-exec.c b/src/interfaces/libpq/fe-exec.c index 3d46e150678..828f18e1110 100644 --- a/src/interfaces/libpq/fe-exec.c +++ b/src/interfaces/libpq/fe-exec.c @@ -2514,20 +2514,18 @@ PQendcopy(PGconn *conn) * PQfn - Send a function call to the POSTGRES backend. * * conn : backend connection - * fnid : function id - * result_buf : pointer to result buffer (&int if integer) - * result_len : length of return value. - * actual_result_len: actual length returned. (differs from result_len - * for varlena structures.) - * result_type : If the result is an integer, this must be 1, + * fnid : OID of function to be called + * result_buf : pointer to result buffer + * result_len : actual length of result is returned here + * result_is_int : If the result is an integer, this must be 1, * otherwise this should be 0 - * args : pointer to an array of function arguments. + * args : pointer to an array of function arguments * (each has length, if integer, and value/pointer) * nargs : # of arguments in args array. * * RETURNS * PGresult with status = PGRES_COMMAND_OK if successful. - * *actual_result_len is > 0 if there is a return value, 0 if not. + * *result_len is > 0 if there is a return value, 0 if not. * PGresult with status = PGRES_FATAL_ERROR if backend returns an error. * NULL on communications failure. conn->errorMessage will be set. * ---------------- @@ -2537,12 +2535,12 @@ PGresult * PQfn(PGconn *conn, int fnid, int *result_buf, - int *actual_result_len, + int *result_len, int result_is_int, const PQArgBlock *args, int nargs) { - *actual_result_len = 0; + *result_len = 0; if (!conn) return NULL; @@ -2560,12 +2558,12 @@ PQfn(PGconn *conn, if (PG_PROTOCOL_MAJOR(conn->pversion) >= 3) return pqFunctionCall3(conn, fnid, - result_buf, actual_result_len, + result_buf, result_len, result_is_int, args, nargs); else return pqFunctionCall2(conn, fnid, - result_buf, actual_result_len, + result_buf, result_len, result_is_int, args, nargs); } |