Skip to content

Commit 6cbee65

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 2e70d6b commit 6cbee65

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
@@ -3199,9 +3199,10 @@ void PQclear(PGresult *res);
31993199

32003200
<listitem>
32013201
<para>
3202-
Returns the number of rows (tuples) in the query result. Because
3203-
it returns an integer result, large result sets might overflow the
3204-
return value on 32-bit operating systems.
3202+
Returns the number of rows (tuples) in the query result.
3203+
(Note that <structname>PGresult</> objects are limited to no more
3204+
than <literal>INT_MAX</> rows, so an <type>int</> result is
3205+
sufficient.)
32053206

32063207
<synopsis>
32073208
int PQntuples(const PGresult *res);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy