From f0c3a09ab31f8fe4de71c666b1f2dcb830271547 Mon Sep 17 00:00:00 2001 From: Neil Conway Date: Sat, 24 Apr 2004 22:53:44 +0000 Subject: [PATCH] Document that PQoidValue(), PQcmdTuples(), and PQoidStatus() now work when the command that generated the PGresult was an EXECUTE of an appropriate prepared statement. --- doc/src/sgml/libpq.sgml | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 4fa8688e3d..0d532a7844 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1,5 +1,5 @@ @@ -1941,14 +1941,19 @@ char *PQcmdTuples(PGresult *res); - If the SQL command that generated the - PGresult was INSERT, - UPDATE, DELETE, MOVE, - or FETCH, this returns a - string containing the number of rows affected. If the - command was anything else, it returns the empty string. The - caller should not free the result directly. It will be freed - when the associated PGresult handle is passed to + This function returns a string containing the number of rows + affected by the SQL statement that generated the + PGresult. This function can only be used + following the execution of an INSERT, + UPDATE, DELETE, MOVE, or + FETCH statement, or an EXECUTE of a + prepared query that contains a INSERT, + UPDATE, or DELETE statement. If the + command that generated the PGresult was + anything else, PQcmdTuples returns the empty + string. The caller should not free the return value + directly. It will be freed when the associated + PGresult handle is passed to PQclear. @@ -1959,11 +1964,14 @@ char *PQcmdTuples(PGresult *res); Returns the OIDOIDin - libpq of the inserted row, if the - SQL command was an - INSERT that inserted exactly one row into - a table that has OIDs. Otherwise, returns - InvalidOid. + libpq of the inserted row, if the SQL + command was an INSERT that inserted exactly one + row into a table that has OIDs, or a EXECUTE of + a prepared query containing a suitable INSERT + statement. Otherwise, this function returns + InvalidOid. This function will also + return InvalidOid if the table affected + by the INSERT statement does not contain OIDs. Oid PQoidValue(const PGresult *res); @@ -1977,7 +1985,9 @@ Oid PQoidValue(const PGresult *res); Returns a string with the OID of the inserted row, if the SQL command was an - INSERT. (The string will be + INSERT that inserted exactly one row, or + a EXECUTE of a prepared statement + consisting of a suitable INSERT. (The string will be 0 if the INSERT did not insert exactly one row, or if the target table does not have OIDs.) If the command was not an INSERT, -- 2.40.0