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 dependency handling of column drop with partitioned tables
Date: Sun, 13 Oct 2019 08:54:19 +0000
Message-ID: <E1iJZdr-0005DB-GE@gemulon.postgresql.org> (raw)

Fix dependency handling of column drop with partitioned tables

When dropping a column on a partitioned table which has one or more
partitioned indexes, the operation was failing as dependencies with
partitioned indexes using the column dropped were not getting removed in
a way consistent with the columns involved across all the relations part
of an inheritance tree.

This commit refactors the code executing column drop so as all the
columns from an inheritance tree to remove are gathered first, and
dropped all at the end.  This way, we let the dependency machinery sort
out by itself the deletion of all the columns with the partitioned
indexes across a partition tree.

This issue has been introduced by 1d92a0c, so backpatch down to
REL_12_STABLE.

Author: Amit Langote, Michael Paquier
Reviewed-by: Álvaro Herrera, Ashutosh Sharma
Discussion: https://postgr.es/m/CA+HiwqE9kuBsZ3b5pob2-cvE8ofzPWs-og+g8bKKGnu6b4-yTQ@mail.gmail.com
Backpatch-through: 12

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3a58c5f1464bf5bb5e602477222da88ee201392c

Modified Files
--------------
src/backend/commands/tablecmds.c       | 41 +++++++++++++++++------
src/test/regress/expected/indexing.out | 61 ++++++++++++++++++++++++++++++++++
src/test/regress/sql/indexing.sql      | 21 ++++++++++++
3 files changed, 113 insertions(+), 10 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1iJZdr-0005DB-GE@gemulon.postgresql.org>
Permalink:  ../E1iJZdr-0005DB-GE@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1iJZdr-0005DB-GE@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix dependency handling of column drop with partitioned tables
  In-Reply-To: <E1iJZdr-0005DB-GE@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