Re: first_value()/nth_value() with IGNORE NULLS loop forever (EXCLUDE GROUP/TIES, frame past partition end, no ORDER BY)

From: Tatsuo Ishii <ishii(at)postgresql(dot)org>
To: zhong950419(at)gmail(dot)com
Cc: c(dot)bhuvan(at)iitg(dot)ac(dot)in, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: first_value()/nth_value() with IGNORE NULLS loop forever (EXCLUDE GROUP/TIES, frame past partition end, no ORDER BY)
Date: 2026-11-04 07:44:15
Message-ID: 20261104.164415.1303787863463904189.ishii@postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi Shihao,

> Hi Bhuvan,
>
> Thanks for the report and the patch. I can reproduce all five queries
> on master and on 19rc1.
>
> This came in with 25a30bbd423. I think it belongs on the 19 open items.
>
> https://wiki.postgresql.org/wiki/PostgreSQL_19_Open_Items

Yeah, I have just added this to the 19 open items.

> With your patch all five return at once and the regression tests
> pass. I also compared the three functions against array_agg(x) FILTER
> (WHERE x IS NOT NULL) over about 11k frame combinations. That included
> spill to disk and volatile arguments. No differences.
>
> One suggestion for the test. Could you add last_value IGNORE NULLS
> with EXCLUDE TIES and no ORDER BY? It scans backward, so it would
> catch a later fix in row_is_in_frame that returns -1 for every
> position after the current row.

I have just started to read the discussion and patches. Just to
clarify, is the test for feature improvement of row_is_in_frame?

Regards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Richard Guo 2026-11-04 07:47:57 Re: Incorrect NOT IN results with implicit casts returning NULL after anti-join optimization
Previous Message shihao zhong 2026-11-04 05:42:55 Re: BUG #19780: gtsvector_picksplit() reads uninitialized data when called with three entries