Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+5-1
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)