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