On 3 July 2018 at 21:53, Michael Paquier <michael@paquier.xyz> wrote:
> Your patch removes this part:
> - /*
> - * If the partitioned table has no partitions or all the partitions are
> - * temporary tables from other backends, treat this as non-inheritance
> - * case.
> - */
> - if (!has_child)
> - parentrte->inh = false;
>
> And adds this equivalent part:
> + /*
> + * If the partitioned table has no partitions, treat this as the
> + * non-inheritance case.
> + */
> + if (partdesc->nparts == 0)
> + {
> + parentrte->inh = false;
> + return;
> + }
>
> As far as I can see from the coverage report, the former is not tested,
> and corresponds to the case of a partition leaf which is itself
> partitioned but has no partitions, and the new portion is equivalent to
> the part removed. That ought to be tested, particularly as Amit
> mentions that there could be improvements with moving it around in
> future versions.
Oh okay. Yeah, you can hit that with a partitionless sub-partitioned table.
I've added a test in the attached v4.
--
David Rowley http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services