8000 Doc: document libpq's restriction to INT_MAX rows in a PGresult. · yazun/postgres@2a82170 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 2a82170

Browse files
committed
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
1 parent a07058a commit 2a82170

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/src/sgml/libpq.sgml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2763,9 +2763,10 @@ void PQclear(PGresult *res);
27632763

27642764
<listitem>
27652765
<para>
2766-
Returns the number of rows (tuples) in the query result. Because
2767-
it returns an integer result, large result sets might overflow the
2768-
return value on 32-bit operating systems.
2766+
Returns the number of rows (tuples) in the query result.
2767+
(Note that <structname>PGresult</> objects are limited to no more
2768+
than <literal>INT_MAX</> rows, so an <type>int</> result is
2769+
sufficient.)
27692770

27702771
<synopsis>
27712772
int PQntuples(const PGresult *res);

0 commit comments

Comments
 (0)
0