From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix partition tuple routing with dropped attributes
Date: Mon, 08 Apr 2019 04:46:15 +0000
Message-ID: <E1hDMAh-0005YN-N9@gemulon.postgresql.org> (raw)
Fix partition tuple routing with dropped attributes
When trying to insert a tuple into a partitioned table, the routing to
the correct partition has been messed up by mixing when a tuple needs to
be stored in an intermediate parent's slot and when a tuple needs to be
converted because of attribute changes between the immediate parent
relation and the parent relation one level above that (the grandparent).
This could trigger errors like the following:
ERROR: cannot extract attribute from empty tuple slot SQL state: XX000
This was not detected because regression tests with dropped attributes
only included tests with two levels of partitioning, and this can be
triggered with three levels or more.
This fixes bug #15733, which has been introduced by 34295b8. The bug
happens only on REL_11_STABLE and HEAD gains the regression tests added
for this bug.
Reported-by: Petr Fedorov
Author: Amit Langote, Michael Paquier
Discussion: https://postgr.es/m/15733-7692379e310b80ec@postgresql.org
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/6b0208ebc436b33bd80ce264299b4b1b8d59b68a
Modified Files
--------------
src/backend/executor/execPartition.c | 39 +++++++++++++++++++++-------------
src/test/regress/expected/insert.out | 41 ++++++++++++++++++++++++++++++++++++
src/test/regress/sql/insert.sql | 28 ++++++++++++++++++++++++
3 files changed, 93 insertions(+), 15 deletions(-)
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-committers@postgresql.org
Cc: michael@paquier.xyz
Subject: Re: pgsql: Fix partition tuple routing with dropped attributes
In-Reply-To: <E1hDMAh-0005YN-N9@gemulon.postgresql.org>
References: <E1hDMAh-0005YN-N9@gemulon.postgresql.org>
* 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