pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix partitioned index creation bug with dropped columns
Date: Tue, 26 Mar 2019 23:25:31 +0000
Message-ID: <E1h8vRj-0005kg-Ba@gemulon.postgresql.org> (raw)

Fix partitioned index creation bug with dropped columns

ALTER INDEX .. ATTACH PARTITION fails if the partitioned table where the
index is defined contains more dropped columns than its partition, with
this message:
  ERROR:  incorrect attribute map
The cause was that one caller of CompareIndexInfo was passing the number
of attributes of the partition rather than the parent, which confused
the length check.  Repair.

This can cause pg_upgrade to fail when used on such a database.  Leave
some more objects around after regression tests, so that the case is
detected by pg_upgrade test suite.

Remove some spurious empty lines noticed while looking for other cases
of the same problem.

Discussion: https://postgr.es/m/20190326213924.GA2322@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/126d631222328d3def7910934bfa9cbdc99d79cc

Modified Files
--------------
src/backend/catalog/index.c            | 1 -
src/backend/commands/indexcmds.c       | 1 -
src/backend/commands/tablecmds.c       | 2 +-
src/test/regress/expected/indexing.out | 5 +++++
src/test/regress/sql/indexing.sql      | 5 +++++
5 files changed, 11 insertions(+), 3 deletions(-)



view thread (2+ messages)

Message-ID: <E1h8vRj-0005kg-Ba@gemulon.postgresql.org>
Permalink:  ../E1h8vRj-0005kg-Ba@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1h8vRj-0005kg-Ba@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: alvherre@alvh.no-ip.org
  Subject: Re: pgsql: Fix partitioned index creation bug with dropped columns
  In-Reply-To: <E1h8vRj-0005kg-Ba@gemulon.postgresql.org>
  References: <E1h8vRj-0005kg-Ba@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