Re: reindexing an invalid index should not use ERRCODE_INDEX_CORRUPTED

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Noah Misch <noah@leadboat.com>
Cc: Andres Freund <andres@anarazel.de>, pgsql-hackers@postgresql.org, Michael Paquier <michael.paquier@gmail.com>, Peter Eisentraut <peter@eisentraut.org>
Date: 2023-12-07T01:32:33Z
Lists: pgsql-hackers

Attachments

On Wed, Dec 06, 2023 at 04:33:33PM -0800, Noah Misch wrote:
> On Wed, Dec 06, 2023 at 03:17:12PM +0900, Michael Paquier wrote:
>>> The "cannot" part of the message is also inaccurate, and it's not clear to me
>>> why we have this specific restriction at all.  REINDEX INDEX CONCURRENTLY
>>> accepts such indexes, so I doubt it's an implementation gap.
>> 
>> If you would reword that, what would you change?
> 
> I'd do "skipping reindex of invalid index \"%s.%s\"".  If one wanted more,

In line with vacuum.c, that sounds like a good idea at the end.

> errhint("Use DROP INDEX or REINDEX INDEX.") would fit.

I'm OK with this suggestion as well.
--
Michael

Commits

  1. Improve some error messages with invalid indexes for REINDEX CONCURRENTLY