| From: | Fujii Masao <masao(dot)fujii(at)gmail(dot)com> |
|---|---|
| To: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
| Cc: | Tatsuo Ishii <ishii(at)postgresql(dot)org>, jian(dot)universality(at)gmail(dot)com, pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: IGNORE/RESPECT NULLS can be specified for (prokind == 'f'). |
| Date: | 2026-06-18 07:54:04 |
| Message-ID: | CAHGQGwGdjjfiMUP=6o=2y9YYW7D3mQ_X=rHFYL3o3tJLYMZBnw@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Thu, Jun 18, 2026 at 12:06 PM Chao Li <li(dot)evan(dot)chao(at)gmail(dot)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
| Attachment | Content-Type | Size |
|---|---|---|
| v2-0001-Refine-error-reporting-for-null-treatment-on-non-.patch | application/octet-stream | 5.5 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chao Li | 2026-06-18 08:17:43 | Re: IGNORE/RESPECT NULLS can be specified for (prokind == 'f'). |
| Previous Message | Henson Choi | 2026-06-18 07:48:54 | Re: Row pattern recognition |