diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2017-08-29 15:38:05 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2017-08-29 15:38:34 -0400 |
commit | 2338ad26374ef27c7601bb5a1517a6a0c82ef94e (patch) | |
tree | b5d251b079a856c3c603325c4a74345db7ae6f15 | |
parent | 1c53722ffd0088679cb548da2bce569b5c2f9732 (diff) | |
download | postgresql-2338ad26374ef27c7601bb5a1517a6a0c82ef94e.tar.gz postgresql-2338ad26374ef27c7601bb5a1517a6a0c82ef94e.zip |
Doc: document libpq's restriction to INT_MAX rows in a PGresult.
As long as PQntuples, PQgetvalue, etc, use "int" for row numbers, we're
pretty much stuck with this limitation. The documentation formerly stated
that the result of PQntuples "might overflow on 32-bit operating systems",
which is just nonsense: that's not where the overflow would happen, and
if you did reach an overflow it would not be on a 32-bit machine, because
you'd have OOM'd long since.
Discussion: https://postgr.es/m/CA+FnnTxyLWyjY1goewmJNxC==HQCCF4fKkoCTa9qR36oRAHDPw@mail.gmail.com
-rw-r--r-- | doc/src/sgml/libpq.sgml | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 9ec291d5c4c..f23ecbe4c48 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -2871,9 +2871,10 @@ void PQclear(PGresult *res); <listitem> <para> - Returns the number of rows (tuples) in the query result. Because - it returns an integer result, large result sets might overflow the - return value on 32-bit operating systems. + Returns the number of rows (tuples) in the query result. + (Note that <structname>PGresult</> objects are limited to no more + than <literal>INT_MAX</> rows, so an <type>int</> result is + sufficient.) <synopsis> int PQntuples(const PGresult *res); |