Improve some error messages with invalid indexes for REINDEX CONCURRENTLY
Michael Paquier <michael@paquier.xyz>
Improve some error messages with invalid indexes for REINDEX CONCURRENTLY An invalid index is skipped when doing REINDEX CONCURRENTLY at table level, with INDEX_CORRUPTED used as errcode. This is confusing, because an invalid index could exist after an interruption. The errcode is switched to OBJECT_NOT_IN_PREREQUISITE_STATE instead, as per a suggestion from Andres Freund. While on it, the error messages are reworded, and a hint is added, telling how to rebuild an invalid index in this case. This has been suggested by Noah Misch. Discussion: https://postgr.es/m/20231118230958.4fm3fhk4ypshxopa@awork3.anarazel.de
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/indexcmds.c | modified | +8 −6 |
| src/test/regress/expected/create_index.out | modified | +2 −1 |
Discussion
- reindexing an invalid index should not use ERRCODE_INDEX_CORRUPTED 7 messages · 2023-11-18 → 2023-12-07