Re: pgsql: Clarify use of temporary tables within partition trees

From: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Robert Haas <robertmhaas(at)gmail(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, pgsql-committers <pgsql-committers(at)postgresql(dot)org>
Subject: Re: pgsql: Clarify use of temporary tables within partition trees
Date: 2018-07-03 11:16:55
Message-ID: CAKJS1f8ZerDq68ZTk9djC8unduhzCYN2ubHt_ornhtWSn_WByQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On 3 July 2018 at 21:53, Michael Paquier <michael(at)paquier(dot)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 Content-Type Size
remove_dead_code_from_expand_partitioned_rtentry_v4.patch application/octet-stream 3.5 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2018-07-03 11:31:27 Re: pgsql: Clarify use of temporary tables within partition trees
Previous Message Michael Paquier 2018-07-03 09:53:43 Re: pgsql: Clarify use of temporary tables within partition trees

Browse pgsql-hackers by date

  From Date Subject
Next Message Moon, Insung 2018-07-03 11:17:48 RE: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)
Previous Message amul sul 2018-07-03 10:58:30 Re: Failed assertion due to procedure created with SECURITY DEFINER option