From: Tom Lane <tgl@sss.pgh.pa.us>
To: imchifan8@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #19885: pg_input_is_valid(tsquery) throws stack depth error instead of returning false
Date: Thu, 12 Nov 2026 12:33:28 -0500
Message-ID: <45963.1794504808@sss.pgh.pa.us> (raw)
In-Reply-To: <19885-741df1acb48cdad1@postgresql.org>
References: <19885-741df1acb48cdad1@postgresql.org>
PG Bug reporting form <noreply@postgresql.org> writes:
> pg_input_is_valid() throws SQLSTATE 54001 while validating a deeply
> parenthesized tsquery when max_stack_depth is 100kB.
I do not think this is a bug. pg_input_is_valid() does not promise
to avoid throwing a hard error for resource-exhaustion cases.
As a counterexample, if you hit OOM while constructing the input
string, it'd fail before ever reaching pg_input_is_valid().
Also, if we were to accept this as a case that should be handled,
there are many many more in the same class.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, imchifan8@gmail.com
Subject: Re: BUG #19885: pg_input_is_valid(tsquery) throws stack depth error instead of returning false
In-Reply-To: <45963.1794504808@sss.pgh.pa.us>
References: <19885-741df1acb48cdad1@postgresql.org> <45963.1794504808@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