pgsql: Preserve opclass parameters across REINDEX CONCURRENTLY - Mailing list pgsql-committers

From Michael Paquier
Subject pgsql: Preserve opclass parameters across REINDEX CONCURRENTLY
Date
Msg-id E1mhNGI-0003wG-S6@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Preserve opclass parameters across REINDEX CONCURRENTLY

The opclass parameter Datums from the old index are fetched in the same
way as for predicates and expressions, by grabbing them directly from
the system catalogs.  They are then copied into the new IndexInfo that
will be used for the creation of the new copy.

This caused the new index to be rebuilt with default parameters rather
than the ones pre-defined by a user.  The only way to get back a new
index with correct opclass parameters would be to recreate a new index
from scratch.

The issue has been introduced by 911e702.

Author: Michael Paquier
Reviewed-by: Zhihong Yu
Discussion: https://postgr.es/m/YX0CG/QpLXcPr8HJ@paquier.xyz
Backpatch-through: 13

Branch
------
master

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

Modified Files
--------------
src/backend/catalog/index.c                | 10 ++++++++++
src/test/regress/expected/create_index.out | 19 +++++++++++++++++++
src/test/regress/sql/create_index.sql      |  9 +++++++++
3 files changed, 38 insertions(+)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Don't try to read a multi-GB pg_stat_statements file in one call
Next
From: Michael Paquier
Date:
Subject: pgsql: Add TAP test for pg_receivewal with timeline switch