pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tatsuo Ishii <ishii@postgresql.org>
To: zhong950419@gmail.com
Cc: masao.fujii@gmail.com
Cc: c.bhuvan@iitg.ac.in
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: first_value()/nth_value() with IGNORE NULLS loop forever (EXCLUDE GROUP/TIES, frame past partition end, no ORDER BY)
Date: Mon, 09 Nov 2026 09:19:50 +0900 (JST)
Message-ID: <20261109.091950.2016703765973000585.ishii@postgresql.org> (raw)
In-Reply-To: <CAGRkXqQEwe4aP-1eo3b8qJ_A2cxPQGd=n1U4-36z5CZx_niFxA@mail.gmail.com>
References: <CAHGQGwFTmdD5T+7z8kZekrjVkA=Z2yNhq43ff3AuoxPVxDXP1A@mail.gmail.com>
	<20261107.091833.1799286331446051531.ishii@postgresql.org>
	<CAGRkXqQEwe4aP-1eo3b8qJ_A2cxPQGd=n1U4-36z5CZx_niFxA@mail.gmail.com>

> I agree about nth_value() with RESPECT NULLS. It has always worked
> this way.
> 
> But for ROWS frames row_is_in_frame() can tell from the position
> alone that the row is out of frame. The attached patch moves that call
> back in front of the partition end check. Fujii-san's query returns
> NULL again, and the loop from the original report still ends.

Thanks for the patch. I had thought about a similar fix but still am
not convinced it's worth the trouble.

Let's continue the discussion on it after 19 GA is out.

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






view thread (17+ messages)  latest in thread

Message-ID: <20261109.091950.2016703765973000585.ishii@postgresql.org>
Permalink:  ../20261109.091950.2016703765973000585.ishii@postgresql.org/
Also on:    postgresql.org/message-id/20261109.091950.2016703765973000585.ishii@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: ishii@postgresql.org, zhong950419@gmail.com, masao.fujii@gmail.com, c.bhuvan@iitg.ac.in
  Subject: Re: first_value()/nth_value() with IGNORE NULLS loop forever (EXCLUDE GROUP/TIES, frame past partition end, no ORDER BY)
  In-Reply-To: <20261109.091950.2016703765973000585.ishii@postgresql.org>
  References: <CAHGQGwFTmdD5T+7z8kZekrjVkA=Z2yNhq43ff3AuoxPVxDXP1A@mail.gmail.com> <20261107.091833.1799286331446051531.ishii@postgresql.org> <CAGRkXqQEwe4aP-1eo3b8qJ_A2cxPQGd=n1U4-36z5CZx_niFxA@mail.gmail.com> <20261109.091950.2016703765973000585.ishii@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox