From 94f6209598af6379858b54a890a1ac5ac5d37313 Mon Sep 17 00:00:00 2001 From: Henson Choi Date: Sun, 28 Jun 2026 15:08:45 +0900 Subject: [PATCH] Include row positions in WindowObject mark-position error window_gettupleslot() raises a can't-happen error when asked for a row before the WindowObject's mark position. Include the requested position and the mark position in the message, which makes the diagnostic directly useful if it ever fires. --- src/backend/executor/nodeWindowAgg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/backend/executor/nodeWindowAgg.c b/src/backend/executor/nodeWindowAgg.c index 8a78cb94948..059eac700da 100644 --- a/src/backend/executor/nodeWindowAgg.c +++ b/src/backend/executor/nodeWindowAgg.c @@ -3576,7 +3576,8 @@ window_gettupleslot(WindowObject winobj, int64 pos, TupleTableSlot *slot) return false; if (pos < winobj->markpos) - elog(ERROR, "cannot fetch row before WindowObject's mark position"); + elog(ERROR, "cannot fetch row: " INT64_FORMAT " before WindowObject's mark position: " INT64_FORMAT, + pos, winobj->markpos); oldcontext = MemoryContextSwitchTo(winstate->ss.ps.ps_ExprContext->ecxt_per_query_memory);