Hello,
I was looking at https://www.postgresql.org/docs/current/limits.html
(was brought up by a customer) and found we are missing the limitation
of the string of the SQL to be executed (it's 1GB which is the longest
string postgres can hold)
```
/* It's possible we could use a different value for this in frontend code */
#define MaxAllocSize ((Size) 0x3fffffff) /* 1 gigabyte - 1 */
```
Would there be any objections to adding such limitations in the list
from the link above?
Attached in a proposed patch which adds this to the documentation. I
also added a paragraph mentioning why the field and query length are
limited by 1GB.
--
Martín Marqués
It’s not that I have something to hide,
it’s that I have nothing I want you to see
diff --git a/doc/src/sgml/limits.sgml b/doc/src/sgml/limits.sgml
index 7713ff7177..b9c0a05b75 100644
--- a/doc/src/sgml/limits.sgml
+++ b/doc/src/sgml/limits.sgml
@@ -68,6 +68,12 @@
<entry></entry>
</row>
+ <row>
+ <entry>query string length</entry>
+ <entry>1 GB</entry>
+ <entry></entry>
+ </row>
+
<row>
<entry>identifier length</entry>
<entry>63 bytes</entry>
@@ -111,6 +117,11 @@
stored inside the heap tuple.
</para>
+ <para>
+ Both the field size and the query string length are limited to 1GB as that
+ is the maximum size of a string representation.
+ </para>
+
<para>
Columns that have been dropped from the table also contribute to the maximum
column limit. Moreover, although the dropped column values for newly