From aa7e7ae9a6adfd5553ed05144cf765fbf7c8f5af Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Tue, 16 Feb 2010 20:58:14 +0000 Subject: Have SELECT and CREATE TABLE AS queries return a row count. While this is invisible in psql, other interfaces, like libpq, make this value visible. Boszormenyi Zoltan --- doc/src/sgml/libpq.sgml | 21 ++++++++++----------- doc/src/sgml/protocol.sgml | 8 +++++++- 2 files changed, 17 insertions(+), 12 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index c7131fea4c4..4972a8c2592 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -1,4 +1,4 @@ - + <application>libpq</application> - C Library @@ -2869,12 +2869,11 @@ typedef struct { - Retrieving Result Information for Other Commands + Retrieving Other Result Information - These functions are used to extract information from - PGresult objects that are not - SELECT results. + These functions are used to extract other information from + PGresult objects. @@ -2925,12 +2924,12 @@ typedef struct { 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, FETCH, or - COPY statement, or an EXECUTE of a - prepared query that contains an INSERT, - UPDATE, or DELETE statement. If the - command that generated the PGresult was anything + the execution of a SELECT, CREATE TABLE AS, + INSERT, UPDATE, DELETE, + MOVE, FETCH, or COPY statement, + or an EXECUTE of a prepared query that contains an + INSERT, UPDATE, or DELETE statement. + If the command that generated the PGresult was anything else, PQcmdTuples returns an empty string. The caller should not free the return value directly. It will be freed when the associated PGresult handle is passed to diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index 5b69f373243..e4364ec305f 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -1,4 +1,4 @@ - + Frontend/Backend Protocol @@ -2221,6 +2221,12 @@ CommandComplete (B) rows is the number of rows updated. + + For a SELECT or CREATE TABLE AS + command, the tag is SELECT rows + where rows is the number of rows retrieved. + + For a MOVE command, the tag is MOVE rows where -- cgit v1.2.3