From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Rework handling of invalid indexes with REINDEX CONCURRENTLY
Date: Wed, 17 Apr 2019 00:41:32 +0000
Message-ID: <E1hGYdo-0000OE-AN@gemulon.postgresql.org> (raw)
Rework handling of invalid indexes with REINDEX CONCURRENTLY
Per discussion with others, allowing REINDEX INDEX CONCURRENTLY to work
for invalid indexes when working directly on them can have a lot of
value to unlock situations with invalid indexes without having to use a
dance involving DROP INDEX followed by an extra CREATE INDEX
CONCURRENTLY (which would not work for indexes with constraint
dependency anyway). This also does not create extra bloat on the
relation involved as this works on individual indexes, so let's enable
it.
Note that REINDEX TABLE CONCURRENTLY still bypasses invalid indexes as
we don't want to bloat the number of indexes defined on a relation in
the event of multiple and successive failures of REINDEX CONCURRENTLY.
More regression tests are added to cover those behaviors, using an
invalid index created with CREATE INDEX CONCURRENTLY.
Reported-by: Dagfinn Ilmari Mannsåker, Álvaro Herrera
Author: Michael Paquier
Reviewed-by: Peter Eisentraut, Dagfinn Ilmari Mannsåker
Discussion: https://postgr.es/m/20190411134947.GA22043@alvherre.pgsql
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a6dcf9df4d91ff0db23579f9114079abe6f3e2bf
Modified Files
--------------
doc/src/sgml/ref/create_index.sgml | 6 ++--
doc/src/sgml/ref/reindex.sgml | 11 ++++---
src/backend/commands/indexcmds.c | 29 ++++--------------
src/test/regress/expected/create_index.out | 47 ++++++++++++++++++++++++++++++
src/test/regress/sql/create_index.sql | 20 +++++++++++++
5 files changed, 80 insertions(+), 33 deletions(-)
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: Rework handling of invalid indexes with REINDEX CONCURRENTLY
In-Reply-To: <E1hGYdo-0000OE-AN@gemulon.postgresql.org>
References: <E1hGYdo-0000OE-AN@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