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 assertion failure with ALTER TABLE ATTACH PARTITION and inde
Date: Tue, 03 Mar 2020 04:57:34 +0000
Message-ID: <E1j8zcc-0005fX-5u@gemulon.postgresql.org> (raw)

Fix assertion failure with ALTER TABLE ATTACH PARTITION and indexes

Using ALTER TABLE ATTACH PARTITION causes an assertion failure when
attempting to work on a partitioned index, because partitioned indexes
cannot have partition bounds.

The grammar of ALTER TABLE ATTACH PARTITION requires partition bounds,
but not ALTER INDEX, so mixing ALTER TABLE with partitioned indexes is
confusing.  Hence, on HEAD, prevent ALTER TABLE to attach a partition if
the relation involved is a partitioned index.  On back-branches, as
applications may rely on the existing behavior, just remove the
culprit assertion.

Reported-by: Alexander Lakhin
Author: Amit Langote, Michael Paquier
Discussion: https://postgr.es/m/16276-5cd1dcc8fb8be7b5@postgresql.org
Backpatch-through: 11

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0b48f1335dddb7141160e392cccac98edfb3fa85

Modified Files
--------------
src/backend/parser/parse_utilcmd.c     | 12 ++++++++++--
src/test/regress/expected/indexing.out | 17 +++++++++++++++++
src/test/regress/sql/indexing.sql      | 10 ++++++++++
3 files changed, 37 insertions(+), 2 deletions(-)



view thread (3+ messages)  latest in thread

Message-ID: <E1j8zcc-0005fX-5u@gemulon.postgresql.org>
Permalink:  ../E1j8zcc-0005fX-5u@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1j8zcc-0005fX-5u@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 assertion failure with ALTER TABLE ATTACH PARTITION and inde
  In-Reply-To: <E1j8zcc-0005fX-5u@gemulon.postgresql.org>
  References: <E1j8zcc-0005fX-5u@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