From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Preserve clustered index after rewrites with ALTER TABLE
Date: Mon, 06 Apr 2020 02:08:55 +0000
Message-ID: <E1jLHC3-0002cq-JU@gemulon.postgresql.org> (raw)
Preserve clustered index after rewrites with ALTER TABLE
A table rewritten by ALTER TABLE would lose tracking of an index usable
for CLUSTER. This setting is tracked by pg_index.indisclustered and is
controlled by ALTER TABLE, so some extra work was needed to restore it
properly. Note that ALTER TABLE only marks the index that can be used
for clustering, and does not do the actual operation.
Author: Amit Langote, Justin Pryzby
Reviewed-by: Ibrar Ahmed, Michael Paquier
Discussion: https://postgr.es/m/20200202161718.GI13621@telsasoft.com
Backpatch-through: 9.5
Branch
------
REL_11_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/41faafbd75a5c70fa94bf57e408e6b29c4425ceb
Modified Files
--------------
src/backend/commands/tablecmds.c | 46 +++++++++++++++++++++++++++++
src/backend/utils/cache/lsyscache.c | 23 +++++++++++++++
src/include/utils/lsyscache.h | 1 +
src/test/regress/expected/alter_table.out | 48 +++++++++++++++++++++++++++++++
src/test/regress/sql/alter_table.sql | 25 ++++++++++++++++
5 files changed, 143 insertions(+)
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: Preserve clustered index after rewrites with ALTER TABLE
In-Reply-To: <E1jLHC3-0002cq-JU@gemulon.postgresql.org>
References: <E1jLHC3-0002cq-JU@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