Re: "memory exhausted" in query parser/simplifier for many nested parentheses - Mailing list pgsql-bugs

From Tom Lane
Subject Re: "memory exhausted" in query parser/simplifier for many nested parentheses
Date
Msg-id 1073817.1734106118@sss.pgh.pa.us
Whole thread Raw
In response to Re: "memory exhausted" in query parser/simplifier for many nested parentheses  (Tomas Vondra <tomas@vondra.me>)
List pgsql-bugs
Tomas Vondra <tomas@vondra.me> writes:
> On 12/13/24 15:44, Greg Sabino Mullane wrote:
>> Documentation patches are always welcome. Perhaps at https://
>> www.postgresql.org/docs/current/limits.html <https://www.postgresql.org/
>> docs/current/limits.html> ?

> FWIW I don't think it's practical to document such limits in detail.

Yeah.  To take the current example:

1. The grammar nesting limit is imposed by bison, not by us, and it
would be odd for us to be the ones to document it.  We don't even
know whether it's the same across all versions of bison.

2. The stack-overflow limit during optimization is going to manifest
at some ridiculously platform-dependent depth.  It'll depend on
max_stack_depth to begin with, and then the actual number of stack
frames that fit into that will depend on a huge number of factors,
and probably will change in every PG release.  The best the
documentation could possibly do is to mention that there's a limit,
which seems unhelpful.

> Everyone knows the limits exist, and there's a lot of them

This.

            regards, tom lane



pgsql-bugs by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: "memory exhausted" in query parser/simplifier for many nested parentheses
Next
From: Niklas Hambüchen
Date:
Subject: Re: "memory exhausted" in query parser/simplifier for many nested parentheses