postgres.git / summary / log / commit / refs
commit 37e4682520db478d401f423a093bf00fdb8a767c
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Mon Aug 30 20:29:12 2021 +0000
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
src/backend/executor/execMain.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index db554322165..228551a5a16 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -2289,7 +2289,13 @@ EvalPlanQualFetch(EState *estate, Relation relation, int lockmode,
/* otherwise xmin should not be dirty... */
if (TransactionIdIsValid(SnapshotDirty.xmin))
- elog(ERROR, "t_xmin is uncommitted in tuple to be updated");
+ ereport(ERROR,
+ (errcode(ERRCODE_DATA_CORRUPTED),
+ 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 have to
[parent: 3a19f13cc0a3]