Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xOVfW-00000000BSL-1tu3 for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Nov 2026 07:44:27 +0000 Received: from localhost ([127.0.0.1]:39266 helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.98.2) (envelope-from ) id 1xOVfW-00000004Xn2-3amb for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Nov 2026 07:44:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]:53876) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xOVfW-00000004Xmt-2Yea for pgsql-bugs@lists.postgresql.org; Wed, 04 Nov 2026 07:44:26 +0000 Received: from meldrar.postgresql.org ([2a02:c0:301:0:ffff::31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xOVfU-00000000ADG-0NNZ for pgsql-bugs@lists.postgresql.org; Wed, 04 Nov 2026 07:44:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=postgresql.org; s=20171124; h=Content-Transfer-Encoding:Content-Type: Mime-Version:References:In-Reply-To:From:Subject:Cc:To:Message-Id:Date:Sender :Reply-To:Content-ID:Content-Description; bh=5Dh/iYiD1u+TotUBHk/VJnWQNSD5xY4zv4KqgZs8n7k=; b=2Q9/4xUP5ubAsO+aTiqV7CEO5X m8tHwvy+yvsdPjvld/dQ3D77x/kFkzVDHlgPiiJL6YKLG0UFVWvwCRjVXB4oBgVIRE2mMlKb1mgX6 PoInu27JLiyevkIo56LqREum26kgkuKCkifV989VlfVWIv50mhZ6aK/Xbq84SCc4l8nNzb/X7AqMx fs1A4zjgUQxZA9IapUUEz5ZQAaom6tqETlftzVmgs7dQ8hZqw5XcQ3svFHK7Nag1+8vppErFTXmEs 3aQURGaNzIvTj+xDuqAnvG7tpAOtlwxFFqxgS19Fc/8YG/Q/2LG9qTvqIkkEAwbWwhfXmw7jUFSQd 3ugOOCuw==; Received: from [2409:11:4120:300:d5e0:e8c:3d54:49b7] (helo=localhost) by meldrar.postgresql.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1xOVfR-00000000Ktk-2a0l; Wed, 04 Nov 2026 07:44:23 +0000 Date: Wed, 04 Nov 2026 16:44:15 +0900 (JST) Message-Id: <20261104.164415.1303787863463904189.ishii@postgresql.org> To: zhong950419@gmail.com Cc: c.bhuvan@iitg.ac.in, 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) From: Tatsuo Ishii In-Reply-To: References: <20261024.165148.796213861837098561.ishii@postgresql.org> X-Mailer: Mew version 6.8 on Emacs 29.3 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2409:11:4120:300:d5e0:e8c:3d54:49b7 (failed) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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