> On 18 Feb 2026, at 12:58, Kirill Reshke <[email protected]> wrote:
>
> So, v1 changes the errcode for ERR_INDEX_CORRUPTION.
This totally makes sense to me.
And this seems the only such case in nbtdedup.c, other elog() are governing
PageAddItem()'s
cant-happen case. As to others:
elog(ERROR, "fell off the end of index \"%s\"",
elog(ERROR, "no live root page found in index \"%s\"",
elog(ERROR, "root page %u of index \"%s\" has level %u, expected %u",
are of the same kind, but I do not remember seeing them on production.
> For including
> index name, we need
> to pass relation to _bt_swap_posting function, which I did not do in
> v1, because I'm not sure changing is worth it.
When it's the only message in the log - index name would be valuable.
Well, if it's overly complex - probably user (we) will be able to deduce
corrupted index
from a query...
Best regards, Andrey Borodin.