pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix REINDEX CONCURRENTLY of partitions
Date: Fri, 12 Apr 2019 06:43:11 +0000
Message-ID: <E1hEpu3-0008SB-BF@gemulon.postgresql.org> (raw)

Fix REINDEX CONCURRENTLY of partitions

In case of a partition index, when swapping the old and new index, we
also need to attach the new index as a partition and detach the old
one.  Also, to handle partition indexes, we not only need to change
dependencies referencing the index, but also dependencies of the index
referencing something else.  The previous code did this only
specifically for a constraint, but we also need to do this for
partitioned indexes.  So instead write a generic function that does it
for all dependencies.

Author: Michael Paquier <michael@paquier.xyz>
Author: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/flat/DF4PR8401MB11964EDB77C860078C343BEBEE5A0%40DF4PR8401MB119...

Branch
------
master

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

Modified Files
--------------
src/backend/catalog/index.c                | 40 +++++++-------
src/backend/catalog/pg_depend.c            | 56 ++++++++++++++++++++
src/include/catalog/dependency.h           |  3 ++
src/test/regress/expected/create_index.out | 85 ++++++++++++++++++++++++++++++
src/test/regress/sql/create_index.sql      | 43 +++++++++++++++
5 files changed, 209 insertions(+), 18 deletions(-)



Message-ID: <E1hEpu3-0008SB-BF@gemulon.postgresql.org>
Permalink:  ../E1hEpu3-0008SB-BF@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hEpu3-0008SB-BF@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: peter@eisentraut.org
  Subject: Re: pgsql: Fix REINDEX CONCURRENTLY of partitions
  In-Reply-To: <E1hEpu3-0008SB-BF@gemulon.postgresql.org>
  References: <E1hEpu3-0008SB-BF@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