Modernize error message for malformed B-Tree tuple posting

From: Kirill Reshke <reshkekirill(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Modernize error message for malformed B-Tree tuple posting
Date: 2026-02-18 07:58:08
Message-ID: CALdSSPgQQJGvzMs_kMJfTFc=nHJNH1LxKiWo-xKr0HQBXF8UCg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

Today, while routinely fixing corruptions reported by our monitoring,
I observed a message:

2026-02-15 01:38:33.060
MSK,"<cut>","<cut>",1725745,"localhost:51330",6990f425.1a5531,1,"UPDATE",2026-02-15
01:16:05 MSK,59/1760774,183431134,ERROR,XX000,"posting list tuple with
3 items cannot be split at offset 20",,,,,,"UPDATE .... <there was
origin query,cut>,,,"","client backend",,3082007398573165030

So, two things are bothering me here. First, this is XX000 and not
XX002 which I cannot find a good reason to. Second, Index name is not
present in the error message.

Another about-corruption error messages seems to be different, for example:

ERROR,XX002,"table tid from new index tuple (58084,119) overlaps with
invalid duplicate tuple at offset 62 of block 181 in index ""<cut
name>""",,,,,,"UPDATE <cut query>

So, v1 changes the errcode for ERR_INDEX_CORRUPTION. 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.

WDYT?

--
Best regards,
Kirill Reshke

Attachment Content-Type Size
v1-0001-Modernize-error-message-for-malformed-B-Tree-tupl.patch application/octet-stream 1.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Laurenz Albe 2026-02-18 08:03:48 Re: client_connection_check_interval default value
Previous Message Amit Kapila 2026-02-18 07:41:48 Re: [PATCH] Support automatic sequence replication