пн, 12 окт. 2026 г. в 13:14, QQ Mail <781408517(at)qq(dot)com>:
> One regression suggestion: could we also include nth_value with n greater
> than 1? This small case returns the wrong non-NULL value before the patch:
>
> SELECT k, nth_value(k, 2) OVER w,
> (array_agg(k) OVER w)[2] AS expected
> FROM (VALUES (0), (0), (1), (2)) AS t(k)
> WINDOW w AS (
> ORDER BY k
> ROWS BETWEEN 1 FOLLOWING AND UNBOUNDED FOLLOWING
> EXCLUDE TIES
> );
>
> For the first row, the unpatched code returns 1 instead of 2. With v3,
> both columns return 2.
>
>
>
Hi,
Thanks for the test.
Added in v4.