Skip to content

Commit 961dd75

Browse files
committed
Report tuple address in data-corruption error message
Most data-corruption reports mention the location of the problem, but this one failed to. Add it. Backpatch all the way back. In 12 and older, also assign the ERRCODE_DATA_CORRUPTED error code as was done in commit fd6ec93 for 13 and later. Discussion: https://postgr.es/m/202108191637.oqyzrdtnheir@alvherre.pgsql
1 parent a397109 commit 961dd75

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/backend/access/heap/heapam_handler.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,11 @@ heapam_tuple_lock(Relation relation, ItemPointer tid, Snapshot snapshot,
424424
if (TransactionIdIsValid(SnapshotDirty.xmin))
425425
ereport(ERROR,
426426
(errcode(ERRCODE_DATA_CORRUPTED),
427-
errmsg_internal("t_xmin is uncommitted in tuple to be updated")));
427+
errmsg_internal("t_xmin %u is uncommitted in tuple (%u,%u) to be updated in table \"%s\"",
428+
SnapshotDirty.xmin,
429+
ItemPointerGetBlockNumber(&tuple->t_self),
430+
ItemPointerGetOffsetNumber(&tuple->t_self),
431+
RelationGetRelationName(relation))));
428432

429433
/*
430434
* If tuple is being updated by other transaction then we

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy