Re: BUG #19885: pg_input_is_valid(tsquery) throws stack depth error instead of returning false

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: imchifan8(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19885: pg_input_is_valid(tsquery) throws stack depth error instead of returning false
Date: 2026-11-12 17:33:28
Message-ID: 45963.1794504808@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Christophe Pettus 2026-11-12 17:40:30 Re: BUG #19894: CREATE DATABASE logs all-zeros visibility map
Previous Message Tom Lane 2026-11-12 17:22:20 Re: BUG #19826: corr()/regr_r2() of constant input: NULL serially, 1 with partial aggregation