Re: BUG #19037: Planner fails on estimating array length with "no relation entry" error

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: exclusion(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19037: Planner fails on estimating array length with "no relation entry" error
Date: 2025-09-03 01:19:15
Message-ID: 711590.1756862355@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Richard Guo <guofenglinux(at)gmail(dot)com> writes:
> One thing I'm not quite sure about is whether we should backpatch this
> fix to pre-v17 branches. Prior to v17, estimate_array_length() wasn't
> taught to use statistics, so this error isn't reproducible there.
> OTOH, passing a root without a valid simple_rel_array to
> cost_qual_eval() still seems potentially unsafe. What do you think?

Yeah, "is there any other instance of this problem?" is the $64
question here. I was initially thinking v17 is sufficient, but
the possibility that some extension might be vulnerable makes
me lean to back-patching further. Your call ...

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message ocean_li_996 2025-09-03 01:43:12 Re:BUG #19040: Memory leak in hashed subplan node due to missing hashtempcxt reset
Previous Message Richard Guo 2025-09-03 00:42:34 Re: BUG #19037: Planner fails on estimating array length with "no relation entry" error