1
0
mirror of https://github.com/postgres/postgres.git synced 2025-05-05 09:19:17 +03:00

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
This commit is contained in:
Tom Lane 2017-08-29 15:38:05 -04:00
parent bc95e5874a
commit 941e47fc43

View File

@ -3061,9 +3061,10 @@ void PQclear(PGresult *res);
<listitem> <listitem>
<para> <para>
Returns the number of rows (tuples) in the query result. Because Returns the number of rows (tuples) in the query result.
it returns an integer result, large result sets might overflow the (Note that <structname>PGresult</> objects are limited to no more
return value on 32-bit operating systems. than <literal>INT_MAX</> rows, so an <type>int</> result is
sufficient.)
<synopsis> <synopsis>
int PQntuples(const PGresult *res); int PQntuples(const PGresult *res);