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

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Cc: zhong950419(at)gmail(dot)com, 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-06 14:41:26
Message-ID: CAHGQGwFTmdD5T+7z8kZekrjVkA=Z2yNhq43ff3AuoxPVxDXP1A@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Fri, Nov 6, 2026 at 9:26 AM Tatsuo Ishii <ishii(at)postgresql(dot)org> wrote:
> Pushed. Thank you!
>
> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=69b20fdd20de68b0f0eaa855669a6657c65c8533

Thanks for working on this!

The following query succeeded before this fix but fails afterward.
Is this intentional?

WITH t AS MATERIALIZED (
SELECT NULLIF(i, 1) / (2 - i) AS v
FROM generate_series(1, 2) AS g(i)
)
SELECT first_value(v) IGNORE NULLS OVER (ROWS CURRENT ROW)
FROM t
LIMIT 1;

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bertrand Drouvot 2026-11-06 15:18:42 Re: BUG #19733: Row not visible to a new snapshot after its transactional logical decoding message has been streamed
Previous Message Hironobu SUZUKI 2026-11-06 10:39:16 EXPLAIN (ANALYZE, FORMAT JSON) emits invalid output for MERGE on a partitioned table