pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix failure when creating cloned indexes for a partition
Date: Sat, 02 Nov 2019 05:18:42 +0000
Message-ID: <E1iQloA-0003vY-Ce@gemulon.postgresql.org> (raw)

Fix failure when creating cloned indexes for a partition

When using CREATE TABLE for a new partition, the partitioned indexes of
the parent are created automatically in a fashion similar to LIKE
INDEXES.  The new partition and its parent use a mapping for attribute
numbers for this operation, and while the mapping was correctly built,
its length was defined as the number of attributes of the newly-created
child, and not the parent.  If the parent includes dropped columns, this
could cause failures.

This is wrong since 8b08f7d which has introduced the concept of
partitioned indexes, so backpatch down to 11.

Reported-by: Wyatt Alt
Author: Michael Paquier
Reviewed-by: Amit Langote
Discussion: https://postgr.es/m/CAGem3qCcRmhbs4jYMkenYNfP2kEusDXvTfw-q+eOhM0zTceG-g@mail.gmail.com
Backpatch-through: 11

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/dc816e5815913e2b2ae2327a4d3e4d4416ed6898

Modified Files
--------------
src/backend/commands/tablecmds.c           |  2 +-
src/test/regress/expected/create_table.out | 49 ++++++++++++++++++++++++++++++
src/test/regress/sql/create_table.sql      | 23 ++++++++++++++
3 files changed, 73 insertions(+), 1 deletion(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1iQloA-0003vY-Ce@gemulon.postgresql.org>
Permalink:  ../E1iQloA-0003vY-Ce@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iQloA-0003vY-Ce@gemulon.postgresql.org

 · 

reply

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 failure when creating cloned indexes for a partition
  In-Reply-To: <E1iQloA-0003vY-Ce@gemulon.postgresql.org>
  References: <E1iQloA-0003vY-Ce@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