On Mon, 6 Jul 2026 at 00:54, Chengpeng Yan <chengpeng_yan@outlook.com> wrote:
> count(*) FILTER (WHERE ...)
Yeah, looks like we'll need to disable if there's a FILTER clause.
> int exclusion = frameOptions & FRAMEOPTION_EXCLUSION;
> bool plain_count_star = req->window_func->winfnoid == F_COUNT_ &&
> req->window_func->aggfilter == NULL;
>
> if (exclusion &&
> (exclusion != FRAMEOPTION_EXCLUDE_CURRENT_ROW || !plain_count_star))
> {
> req->monotonic = MONOTONICFUNC_NONE;
> PG_RETURN_POINTER(req);
> }
> ```
Given how complex Claude's logic became to get all those cases
correct, I now think the above is the best option. I've attached a
patch for that.
David