agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refine error reporting for null treatment on non-window function
Date: Wed, 24 Jun 2026 02:45:06 +0000
Message-ID: <E1wcDbu-001c5T-1T@gemulon.postgresql.org> (raw)

Refine error reporting for null treatment on non-window functions

Commit 4e5920e6de8 disallowed RESPECT NULLS/IGNORE NULLS on
non-window functions, but it also caused the parser to check for
that clause too early in some cases. As a result, calls such as a
nonexistent function with IGNORE NULLS no longer reported the more
helpful "function ... does not exist" error, and aggregate functions
used as window functions reported "only window functions accept ..."
instead of the more accurate aggregate-specific error.

This commit moves the RESPECT NULLS/IGNORE NULLS checks so that
helpful existing errors are preserved where appropriate. This restores
"function ... does not exist" for nonexistent functions, while still
reporting that plain functions are not window functions and that
aggregates do not accept null treatment.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Tatsuo Ishii <ishii@postgresql.org>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Álvaro Herrera <alvherre@kurilemu.de>
Discussion: https://postgr.es/m/CAHGQGwH7VY_0GkhycyYZ4czkPGL0uGzDyOxk3uuFOSRR7wFY3g@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/419ce13b7019f906ebc010af3be09a9deffc2a47

Modified Files
--------------
src/backend/parser/parse_func.c      | 23 ++++++++++++++---------
src/test/regress/expected/window.out | 17 +++++++++++++++--
src/test/regress/sql/window.sql      |  3 +++
3 files changed, 32 insertions(+), 11 deletions(-)



Message-ID: <E1wcDbu-001c5T-1T@gemulon.postgresql.org>
Permalink:  ../E1wcDbu-001c5T-1T@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wcDbu-001c5T-1T@gemulon.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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Refine error reporting for null treatment on non-window function
  In-Reply-To: <E1wcDbu-001c5T-1T@gemulon.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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox