From: Tom Lane <tgl@sss.pgh.pa.us>
To: Niklas Hambüchen <mail@nh2.me>
Cc: pgsql-bugs@lists.postgresql.org, ruben@benaco.com, Niklas Hambüchen <niklas@benaco.com>
Subject: Re: "memory exhausted" in query parser/simplifier for many nested parentheses
Date: Thu, 12 Dec 2024 11:05:48 -0500
Message-ID: <654489.1734019548@sss.pgh.pa.us> (raw)
In-Reply-To: <161892c0-65fc-42a6-8af9-b098879decd4@nh2.me>
References: <161892c0-65fc-42a6-8af9-b098879decd4@nh2.me>
=?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 in a `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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, mail@nh2.me, niklas@benaco.com
Subject: Re: "memory exhausted" in query parser/simplifier for many nested parentheses
In-Reply-To: <654489.1734019548@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox