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 654489.1734019548@sss.pgh.pa.us
Whole thread Raw
In response to "memory exhausted" in query parser/simplifier for many nested parentheses  (Niklas Hambüchen <mail@nh2.me>)
Responses Re: "memory exhausted" in query parser/simplifier for many nested parentheses
List pgsql-bugs
=?UTF-8?Q?Niklas_Hamb=C3=BCchen?= <mail@nh2.me> writes:
> we noticed that when writing a large query of form
>     (((A OR B) OR C) OR ...)
> with many terms (e.g. 13000) this causes one of two errors:
> 1. memory exhausted at or near "("
> 2. stack depth limit exceeded
> ...
> We consider this a bug because it means one cannot easily generate large queries that query a couple thousand entries
ina `SELECT ... WHERE` condition. 

[ shrug... ]  Even if these examples didn't fail, they would perform
terribly.  Limits are a fact of life.  Write your query some other
way, for example using "x IN (list)" or other shortcut syntaxes.

            regards, tom lane



pgsql-bugs by date:

Previous
From: "Mike Bayer"
Date:
Subject: Re: invalid constraint type "n" when using pg_catalog.pg_get_constraintdef() on pg17, regression from pg16
Next
From: Niklas Hambüchen
Date:
Subject: Re: "memory exhausted" in query parser/simplifier for many nested parentheses