pgsql: Fix lost persistence setting during REINDEX INDEX

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix lost persistence setting during REINDEX INDEX
Date: 2015-03-30 19:03:16
Message-ID: E1Ycexw-0008Uf-A2@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix lost persistence setting during REINDEX INDEX

ReindexIndex() trusts a parser-built RangeVar with the persistence to
use for the new copy of the index; but the parser naturally does not
know what's the persistence of the original index. To find out the
correct persistence, grab it from relcache.

This bug was introduced by commit 85b506bbfc2937c9, and therefore no
backpatch is necessary.

Bug reported by Thom Brown, analysis and patch by Michael Paquier; test
case provided by Fabrízio de Royes Mello.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/0853630159944bb3652336602ff5f7f62cd27a5a

Modified Files
--------------
src/backend/commands/indexcmds.c | 18 ++++++++++++++++--
src/test/regress/expected/create_table.out | 22 ++++++++++++++++++++++
src/test/regress/sql/create_table.sql | 6 ++++++
3 files changed, 44 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2015-03-30 19:29:14 pgsql: Change array_offset to return subscripts, not offsets
Previous Message Tom Lane 2015-03-30 18:59:55 pgsql: Be more careful about printing constants in ruleutils.c.