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

From shihao zhong
Subject Re: BUG #19742: `INTERSECT` under a `UNION ALL` with an empty arm fails with "could not find pathkey item t"
Date
Msg-id CAGRkXqS1Opkj49g=U8fDioTMv+WD=iorH-Jfx9-a=mFrHzuJVA@mail.gmail.com
Whole thread
In response to Re: BUG #19742: `INTERSECT` under a `UNION ALL` with an empty arm fails with "could not find pathkey item t"  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #19742: `INTERSECT` under a `UNION ALL` with an empty arm fails with "could not find pathkey item t"
Next
From: shihao zhong
Date:
Subject: Re: BUG #19731: `first_value` returns an excluded peer for a nonempty `EXCLUDE TIES` frame