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 shihao zhong
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 CAGRkXqRqnmCutng5GryjDeppa1ysn7WhSU9d4Jj027=QRf5KSA@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  (Andrey Rachitskiy <pl0h0yp1@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
Hi Andrey,

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

This patch also covers 19731

Thanks,
Shihao

pgsql-bugs by date:

Previous
From: shihao zhong
Date:
Subject: Re: BUG #19731: `first_value` returns an excluded peer for a nonempty `EXCLUDE TIES` frame
Next
From: Ayush Tiwari
Date:
Subject: Re: BUG #19720: pg_trgm GiST index corruption from gtrgm_union() dropping SIGNKEY