diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2021-08-30 16:29:12 -0400 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2021-08-30 16:29:12 -0400 |
commit | eae08e21653c356f0e9223d26379527d653b71ed (patch) | |
tree | 86522204f83bb8cf9d8f7b915a2da5e0fb8f652f /src/backend/access | |
parent | ce6b662aae7abc8b533b0cfa8fff50a9001508b1 (diff) | |
download | postgresql-eae08e21653c356f0e9223d26379527d653b71ed.tar.gz postgresql-eae08e21653c356f0e9223d26379527d653b71ed.zip |
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 fd6ec93bf890 for
13 and later.
Discussion: https://postgr.es/m/202108191637.oqyzrdtnheir@alvherre.pgsql
Diffstat (limited to 'src/backend/access')
-rw-r--r-- | src/backend/access/heap/heapam_handler.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/backend/access/heap/heapam_handler.c b/src/backend/access/heap/heapam_handler.c index 1b8b640012a..d1192e6a0c5 100644 --- a/src/backend/access/heap/heapam_handler.c +++ b/src/backend/access/heap/heapam_handler.c @@ -424,7 +424,11 @@ tuple_lock_retry: if (TransactionIdIsValid(SnapshotDirty.xmin)) ereport(ERROR, (errcode(ERRCODE_DATA_CORRUPTED), - errmsg_internal("t_xmin is uncommitted in tuple to be updated"))); + errmsg_internal("t_xmin %u is uncommitted in tuple (%u,%u) to be updated in table \"%s\"", + SnapshotDirty.xmin, + ItemPointerGetBlockNumber(&tuple->t_self), + ItemPointerGetOffsetNumber(&tuple->t_self), + RelationGetRelationName(relation)))); /* * If tuple is being updated by other transaction then we |