Make the behavior of HAVING without GROUP BY conform to the SQL spec.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 595ed2a8550e34c0abe64569a104d92ad077ec08
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2005-03-10T23:21:26Z
Releases: 8.1.0
Make the behavior of HAVING without GROUP BY conform to the SQL spec.
Formerly, if such a clause contained no aggregate functions we mistakenly
treated it as equivalent to WHERE.  Per spec it must cause the query to
be treated as a grouped query of a single group, the same as appearance
of aggregate functions would do.  Also, the HAVING filter must execute
after aggregate function computation even if it itself contains no
aggregate functions.

Files