Re: pgsql: Clarify use of temporary tables within partition trees - Mailing list pgsql-committers

From David Rowley
Subject Re: pgsql: Clarify use of temporary tables within partition trees
Date
Msg-id CAKJS1f8ZerDq68ZTk9djC8unduhzCYN2ubHt_ornhtWSn_WByQ@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Clarify use of temporary tables within partition trees  (Michael Paquier <michael@paquier.xyz>)
Responses Re: pgsql: Clarify use of temporary tables within partition trees
List pgsql-committers
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

Attachment

pgsql-committers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: pgsql: Clarify use of temporary tables within partition trees
Next
From: Michael Paquier
Date:
Subject: Re: pgsql: Clarify use of temporary tables within partition trees