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 for dropped columns in a partitioned table's default partiti
Date: Fri, 28 Jun 2019 18:52:22 +0000
Message-ID: <E1hgvyw-0005Ws-Bp@gemulon.postgresql.org> (raw)

Fix for dropped columns in a partitioned table's default partition

We forgot to map column numbers to/from the default partition for
various operations, leading to valid cases failing with spurious
errors, such as
ERROR:  attribute N of type some_partition has been dropped

It was also possible that the search for conflicting rows in the default
partition when attaching another partition would fail to detect some.
Secondarily, it was also possible that such a search should be skipped
(because the constraint was implied) but wasn't.

Fix all this by mapping column numbers when necessary.

Reported by: Daniel Wilches
Author: Amit Langote
Discussion: https://postgr.es/m/15873-8c61945d6b3ef87c@postgresql.org

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/43085a4f693e35d674a9965c484e4e87f18f6d29

Modified Files
--------------
src/backend/commands/tablecmds.c          |  7 +++++++
src/backend/partitioning/partbounds.c     | 24 +++++++++++++++++++-----
src/test/regress/expected/alter_table.out |  9 ++++++++-
src/test/regress/sql/alter_table.sql      |  9 ++++++++-
4 files changed, 42 insertions(+), 7 deletions(-)



view thread (2+ messages)

Message-ID: <E1hgvyw-0005Ws-Bp@gemulon.postgresql.org>
Permalink:  ../E1hgvyw-0005Ws-Bp@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hgvyw-0005Ws-Bp@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 for dropped columns in a partitioned table's default partiti
  In-Reply-To: <E1hgvyw-0005Ws-Bp@gemulon.postgresql.org>
  References: <E1hgvyw-0005Ws-Bp@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