summaryrefslogtreecommitdiff
path: root/src/backend/executor
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2021-08-30 16:29:12 -0400
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2021-08-30 16:29:12 -0400
commit02797ffa9a31db63a6cd499c67700c0de4863e4c (patch)
treea514c5ae05066e24def345c50b9fcc15aeb8d579 /src/backend/executor
parent16cad4be32a44b9d05c594d1f53a60ea6e0f58b6 (diff)
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/executor')
-rw-r--r--src/backend/executor/execMain.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 9ce8c87d995..795d58a1067 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -2621,7 +2621,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