Re: Assert failure in find_var_for_subquery_tle

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Richard Guo <guofenglinux(at)gmail(dot)com>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Assert failure in find_var_for_subquery_tle
Date: 2026-10-11 02:17:35
Message-ID: CAGRkXqRQPMYAQK0sBbvPVXeEGsP=LV7muQmEVsue9R7v=y05EQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Richard,

The fix looks right to me. The new test trips the Assert without the
pathkeys.c change.

A CTE scan as the member hits the same Assert, example:

set_cte_pathlist().
explain (costs off)
with c as materialized (select q2 from int8_tbl order by q2)
select ss.v from int8_tbl x,
lateral (select x.q1 from c union all
select q2 from int8_tbl) ss(v);

The patch fixes this one too. Maybe the commit message could mention
it as well.

Thanks,
Shihao

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-10-11 02:32:20 Re: pg_resetwal: refuse to run when backup_label exists
Previous Message Fujii Masao 2026-10-11 01:50:05 Re: [PG19] Wrong results from NOT NULL-based expression simplification