Skip to content

Commit 6197d7b

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 8ba3bad commit 6197d7b

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
@@ -422,7 +422,11 @@ heapam_tuple_lock(Relation relation, ItemPointer tid, Snapshot snapshot,
422422
if (TransactionIdIsValid(SnapshotDirty.xmin))
423423
ereport(ERROR,
424424
(errcode(ERRCODE_DATA_CORRUPTED),
425-
errmsg_internal("t_xmin is uncommitted in tuple to be updated")));
425+
errmsg_internal("t_xmin %u is uncommitted in tuple (%u,%u) to be updated in table \"%s\"",
426+
SnapshotDirty.xmin,
427+
ItemPointerGetBlockNumber(&tuple->t_self),
428+
ItemPointerGetOffsetNumber(&tuple->t_self),
429+
RelationGetRelationName(relation))));
426430

427431
/*
428432
* If tuple is being updated by other transaction then we

0 commit comments

Comments
 (0)