Re: default partition and concurrent attach partition

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, hawu(at)vmware(dot)com
Subject: Re: default partition and concurrent attach partition
Date: 2020-09-03 21:02:06
Message-ID: 20200903210206.GA12363@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-Sep-03, Alvaro Herrera wrote:

> + /*
> + * If setting up a PartitionDispatch for a sub-partitioned table, we may
> + * also need a fake ResultRelInfo for checking the partition constraint
> + * later; set that up now.
> + */
> + if (parent_pd)
> + {
> + ResultRelInfo *rri = makeNode(ResultRelInfo);
> +
> + InitResultRelInfo(rri, rel, 1, proute->partition_root, 0);
> + proute->nonleaf_partitions[dispatchidx] = rri;
> + }
> +

Heh, I had intended to remove the attachment before sending, because I
thought I was seeing a problem with this proposed coding of mine. But
since I sent it by mistake, I'll explain: I think this will fail if we
have a partitioned default partition, and we direct the insert to it
directly while attaching a partition to its parent. I think that kind
of scenario deserves its own test case.

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-09-03 21:07:10 Re: Parallel worker hangs while handling errors.
Previous Message Tom Lane 2020-09-03 21:01:43 Re: Parallel worker hangs while handling errors.