Hi,

While working on [1], I found the internal error "tuple concurrently updated"
is raised by simple_heap_update and other similar functions, and the comments
on them says "Any failure is reported via ereport()". However, I could not 
understand
the intension of this comments because I suppose the unexpected errors are usual
reported via elog() not ereport and in fact elog() is used in these functions. 

I wonder this statement should be fixed as the attached patch or could be 
removed for
less confusion. Maybe, I am just missing something, though....
 

[1] 
https://www.postgresql.org/message-id/flat/20250331200057.00a62760966a821d484ea904%40sraoss.co.jp

-- 
Yugo Nagata <nag...@sraoss.co.jp>
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 6e433db039e..f47b878f559 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -3207,7 +3207,7 @@ l1:
  * This routine may be used to delete a tuple when concurrent updates of
  * the target tuple are not expected (for example, because we have a lock
  * on the relation associated with the tuple).  Any failure is reported
- * via ereport().
+ * via elog().
  */
 void
 simple_heap_delete(Relation relation, ItemPointer tid)
@@ -4495,7 +4495,7 @@ HeapDetermineColumnsInfo(Relation relation,
  * This routine may be used to update a tuple when concurrent updates of
  * the target tuple are not expected (for example, because we have a lock
  * on the relation associated with the tuple).  Any failure is reported
- * via ereport().
+ * via elog().
  */
 void
 simple_heap_update(Relation relation, ItemPointer otid, HeapTuple tup,
diff --git a/src/backend/access/table/tableam.c b/src/backend/access/table/tableam.c
index a56c5eceb14..eb09272865e 100644
--- a/src/backend/access/table/tableam.c
+++ b/src/backend/access/table/tableam.c
@@ -285,7 +285,7 @@ simple_table_tuple_insert(Relation rel, TupleTableSlot *slot)
  * This routine may be used to delete a tuple when concurrent updates of
  * the target tuple are not expected (for example, because we have a lock
  * on the relation associated with the tuple).  Any failure is reported
- * via ereport().
+ * via elog().
  */
 void
 simple_table_tuple_delete(Relation rel, ItemPointer tid, Snapshot snapshot)
@@ -330,7 +330,7 @@ simple_table_tuple_delete(Relation rel, ItemPointer tid, Snapshot snapshot)
  * This routine may be used to update a tuple when concurrent updates of
  * the target tuple are not expected (for example, because we have a lock
  * on the relation associated with the tuple).  Any failure is reported
- * via ereport().
+ * via elog().
  */
 void
 simple_table_tuple_update(Relation rel, ItemPointer otid,

Reply via email to