Re: BUG #19742: `INTERSECT` under a `UNION ALL` with an empty arm fails with "could not find pathkey item t"

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: David Rowley <dgrowleyml(at)gmail(dot)com>, feasiblechart(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19742: `INTERSECT` under a `UNION ALL` with an empty arm fails with "could not find pathkey item t"
Date: 2026-10-05 02:20:36
Message-ID: CAGRkXqS1Opkj49g=U8fDioTMv+WD=iorH-Jfx9-a=mFrHzuJVA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Tom,
> Fortunately, now that we have Result.relids, it's pretty easy
> to discover which leaf queries are represented and choose the
> leftmost one. Hence, v2 attached.

Thanks, v2 looks good to me. With it, EXPLAIN works on all of the
same 20000 random queries.

With the dummy setop inside a subquery, under a JOIN or GROUP BY,
the Result shows the columns of its own left-most leaf.

Thanks,
Shihao

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message shihao zhong 2026-10-05 02:35:49 Re: BUG #19731: `first_value` returns an excluded peer for a nonempty `EXCLUDE TIES` frame
Previous Message Tom Lane 2026-10-05 00:36:16 Re: BUG #19742: `INTERSECT` under a `UNION ALL` with an empty arm fails with "could not find pathkey item t"