Fix lost persistence setting during REINDEX INDEX
Alvaro Herrera <alvherre@alvh.no-ip.org>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/indexcmds.c | modified | +16 −2 |
| src/test/regress/expected/create_table.out | modified | +22 −0 |
| src/test/regress/sql/create_table.sql | modified | +6 −0 |