Re: IGNORE/RESPECT NULLS can be specified for (prokind == 'f').
Chao Li <li.evan.chao@gmail.com>
From: Chao Li <li.evan.chao@gmail.com>
To: Fujii Masao <masao.fujii@gmail.com>
Cc: Tatsuo Ishii <ishii@postgresql.org>,
jian.universality@gmail.com,
pgsql-hackers@postgresql.org
Date: 2026-06-18T08:17:43Z
Lists: pgsql-hackers
> On Jun 18, 2026, at 15:54, Fujii Masao <masao.fujii@gmail.com> wrote:
>
> On Thu, Jun 18, 2026 at 12:06 PM Chao Li <li.evan.chao@gmail.com> wrote:
>>> Agreed. BTW, if the check is moved there, it might be better to
>>> change the error message according to the surroundings. The pattern is
>>> "... specified, but %s is not a ..."
>>>
>>> errmsg("OVER specified, but %s is not a window function nor an aggregate function",
>>>
>>> So the message could be changed to something like:
>>>
>>> errmsg("RESPECT/IGNORE NULLS is specified, but %s is not a window function"),
>
> Thanks for the review!
>
> I've updated the patch accordingly.
>
> I removed "is" from "RESPECT/IGNORE NULLS is specified" to match other
> similar error messages, which use the form "XXX specified, ...".
>
> + if (ignore_nulls != NO_NULLTREATMENT)
> + ereport(ERROR,
> + (errcode(ERRCODE_WRONG_OBJECT_TYPE),
> + errmsg("aggregate functions do not accept RESPECT/IGNORE NULLS"),
> + parser_errposition(pstate, location)));
>
> I also moved this check to the end of the
> "else if (fdresult == FUNCDETAIL_AGGREGATE)" block. That seems like
> a better place, since the ordered-set aggregate checks should happen
> before this check.
>
> Regards,
>
> --
> Fujii Masao
> <v2-0001-Refine-error-reporting-for-null-treatment-on-non-.patch>
V2 looks good to me.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
Commits
-
Remove stray blank line in ParseFuncOrColumn()
- b07664a179bd 19 (unreleased) landed
- d8113095c488 master landed
-
Refine error reporting for null treatment on non-window functions
- 419ce13b7019 19 (unreleased) landed
-
Fix error message typo.
- ab3023ad1e68 19 (unreleased) landed
-
Fix to not allow null treatment to non window functions.
- 4e5920e6de87 19 (unreleased) landed
-
Add IGNORE NULLS/RESPECT NULLS option to Window functions.
- 25a30bbd4235 19 (unreleased) cited