Re: default partition and concurrent attach partition - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: default partition and concurrent attach partition
Date
Msg-id 20200903210206.GA12363@alvherre.pgsql
Whole thread Raw
In response to Re: default partition and concurrent attach partition  (Alvaro Herrera <alvherre@2ndquadrant.com>)
List 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Parallel worker hangs while handling errors.
Next
From: Alvaro Herrera
Date:
Subject: Re: Parallel worker hangs while handling errors.