Re: BUG #19732: first_value/last_value/nth_value return NULL with EXCLUDE TIES when the current row is outside its f - Mailing list pgsql-bugs

From Andrey Rachitskiy
Subject Re: BUG #19732: first_value/last_value/nth_value return NULL with EXCLUDE TIES when the current row is outside its f
Date
Msg-id CAB8bMiveKc4K7TsR89Rt_ZS_buGnvPD-fysqw_+dRtNECb2mKw@mail.gmail.com
Whole thread
In response to Re: BUG #19732: first_value/last_value/nth_value return NULL with EXCLUDE TIES when the current row is outside its f  (shihao zhong <zhong950419@gmail.com>)
Responses Re: BUG #19732: first_value/last_value/nth_value return NULL with EXCLUDE TIES when the current row is outside its f
List pgsql-bugs

пн, 5 окт. 2026 г. в 07:39, shihao zhong <zhong950419@gmail.com>:

v2 looks good, I checked first_value, last_value and nth_value
against array_agg for every frame shape, and they all match now.

Maybe one more test

SELECT k, first_value(k) OVER w
FROM (VALUES (0), (1), (1), (1), (2)) t(k)
WINDOW w AS (ORDER BY k ROWS BETWEEN 2 FOLLOWING AND UNBOUNDED FOLLOWING
             EXCLUDE TIES);

On Master it report ERROR:  cannot fetch row before WindowObject's mark position


Hi, Shihao!
Thanks for the review.
Added in v3.

Attachment

pgsql-bugs by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: BUG #19628: Uninterruptible vacuum during hash index processing
Next
From: PG Bug reporting form
Date:
Subject: BUG #19751: MIN aggregate + FETCH FIRST 1 ROW WITH TIES causes false 21000 error when index scan is forced