=?utf-8?B?6YKx5a6H6Iiq?= <iamqyh(at)gmail(dot)com> writes:
> And what about the query 2. This is caused by another commit, and
> it's not mentioned in the commit message or the mailing discussion.
That one indeed seems quite broken. EXPLAIN confirms that it's
pushing the HAVING below the aggregation, which is simply wrong
because it fails to filter the all-null row(s) that the aggregation
node will create out of thin air.
Is there anything we can salvage from 67a54b9e, or should
we just revert it?
regards, tom lane