On 10 June 2018 at 04:48, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> So, IIUC, the issue is that for partitioning cases Append expects *all*
> its children to be partitions of the *same* partitioned table? That
> is, you could also break it with
>
> select * from partitioned_table_a
> union all
> select * from partitioned_table_b
>
> ?
Not quite. I think what I sent above is the most simple way to break
it. Your case won't because there are no quals to prune with, so
run-time pruning is never attempted.
> If so, maybe the best solution is to not allow a partitioning appendrel
> to be flattened into an appendrel generated in other ways (particularly,
> via UNION ALL). I also wonder whether it was a bad idea to treat these
> as the same kind of path/plan in the first place.
That might be the best idea. I'll look into that now. The only
drawback I see is that we'll end up pulling tuples through more Append
nodes in cases like you mentioned above.
--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services