Re: [Minor] Clarification on "2.7. Aggregate Functions" - Mailing list pgsql-docs

From David Rowley
Subject Re: [Minor] Clarification on "2.7. Aggregate Functions"
Date
Msg-id CAApHDvqHPe+jX+mXnLY8Sq=8VmrV33y76SU-NYjutT5-g4pA=w@mail.gmail.com
Whole thread
In response to [Minor] Clarification on "2.7. Aggregate Functions"  (PG Doc comments form <noreply@postgresql.org>)
List pgsql-docs
On Tue, 29 Sept 2026 at 21:34, PG Doc comments form
<noreply@postgresql.org> wrote:
>
> The following documentation comment has been logged on the website:
>
> Page: https://www.postgresql.org/docs/18/tutorial-agg.html
> Description:
>
> Where it says: "FILTER is much like WHERE, except that it removes rows only
> from the input of the particular aggregate function that it is attached to.
> Here, the count aggregate counts only rows with temp_lo below 45; but the
> max aggregate is still applied to all rows, so it still finds the reading of
> 46."
> Should say "FILTER is much like WHERE, except that it removes rows only from
> the input of the particular aggregate function that it is attached to. Here,
> the count aggregate counts only rows with temp_lo below 45; but the max
> aggregate is still applied to all rows being considered with the GROUP BY
> clause, so it still finds the reading of 46."
>
> Wording may vary, I think a clarification on this should be an improvement.

i.e. you're suggesting that " being considered with the GROUP BY
clause," is added.

The GROUP BY clause only controls how input rows are grouped and has
no bearing on which rows are aggregated. So, IMO "being considered
with the GROUP BY clause" doesn't seem like an improvement.

I can't quite understand where the ambiguity is that you're trying to
fix. If the reader assumes "all rows" means all rows in the table, or
all rows visited during the execution of the query, they're correct as
the query has no WHERE clause and those two things are the same.

David



pgsql-docs by date:

Previous
From: Oli Sennhauser
Date:
Subject: Little formatting issues in doc
Next
From: Daniel Gustafsson
Date:
Subject: Re: Table 9.31. to_char Examples