https://www.postgresql.org/docs/15/tutorial-agg.html

Started by PG Bug reporting formover 3 years ago2 messagesdocs
Jump to latest
#1PG Bug reporting form
noreply@postgresql.org

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/15/tutorial-agg.html
Description:

city | max | count
---------+-----+-------
Hayward | 37 | 5
(1 row)
it's not right

SELECT city, max(temp_lo), count(*) FILTER (WHERE temp_lo < 30)
FROM weather
GROUP BY city
HAVING max(temp_lo) < 40;

city | max | count
---------+-----+-------
Hayward | 35 | 0

because
SELECT city, max(temp_lo), count(*) FILTER (WHERE temp_lo < 30)
FROM weather
WHERE city LIKE 'S%' -- (1)
GROUP BY city
HAVING max(temp_lo) < 40;
city | max | count
------+-----+-------
(0 rows)

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PG Bug reporting form (#1)
Re: https://www.postgresql.org/docs/15/tutorial-agg.html

PG Doc comments form <noreply@postgresql.org> writes:

Page: https://www.postgresql.org/docs/15/tutorial-agg.html
Description:

city | max | count
---------+-----+-------
Hayward | 37 | 5
(1 row)
it's not right

Yeah, that example is broken. You can see the repaired text at

https://www.postgresql.org/docs/devel/tutorial-agg.html

but it won't propagate to the released-version docs until
our next releases (scheduled for February).

regards, tom lane