From: Michael Paquier <michael@paquier.xyz>
To: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Cc: petr.fedorov@phystech.edu
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15733: An insert destined at partition created after a column has been dropped from the parent table fails
Date: Thu, 4 Apr 2019 19:48:18 +0900
Message-ID: <20190404104818.GM7693@paquier.xyz> (raw)
In-Reply-To: <f555e234-273f-9796-aae4-9dbdd9b360c5@lab.ntt.co.jp>
References: <15733-7692379e310b80ec@postgresql.org>
<20190404013510.GB7693@paquier.xyz>
<f555e234-273f-9796-aae4-9dbdd9b360c5@lab.ntt.co.jp>
On Thu, Apr 04, 2019 at 07:31:09PM +0900, Amit Langote wrote:
> The problem seems to be present only in PG 11; not in PG 10 and HEAD, as
> Michael already said.
>
> It seems to have been introduced by 34295b87f in PG 11, wherein the
> decision of when to add a tuple to an intermediate parent's dedicated
> tuple routing slot is mistakenly getting mixed with the decision of
> whether tuple conversion is required between the parent of the previous
> level and the current parent. We didn't catch that error back then,
> because we only tried up to 2 levels of partitioning, whereas the test
> case presented here uses 3 levels of partitioning. In the reported test
> case, the 1st level needs tuple conversion (between partitioned and
> partitioned_2), but the next level does not (between partitioned_2 and
> partitioned_2_1), so the slot used when routing through partitioned_2_1 to
> the last level doesn't contain a tuple to extract the partition key from,
> hence the error.
Perhaps it would make sense to have this test case on HEAD as well?
It seems to me that there is little point in having a completely new
set of relations to test this issue knowing that multi-level
partitioning is already tested in the same file. Why not extending
the part close to "more tests for certain multi-level partitioning
scenarios" in insert.sql with a mlparted111 or such a thing? This
way, we have a three-layer partitioning and the error can be equally
triggered.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: michael@paquier.xyz, Langote_Amit_f8@lab.ntt.co.jp, petr.fedorov@phystech.edu
Subject: Re: BUG #15733: An insert destined at partition created after a column has been dropped from the parent table fails
In-Reply-To: <20190404104818.GM7693@paquier.xyz>
References: <15733-7692379e310b80ec@postgresql.org> <20190404013510.GB7693@paquier.xyz> <f555e234-273f-9796-aae4-9dbdd9b360c5@lab.ntt.co.jp> <20190404104818.GM7693@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox