"Peter Wright" <pete@flooble.net> writes:
> I think this demonstrates the problem much better than I could explain in
> words. The bug is shown in the two
> SELECT queries with a WHERE clause. Very bizarre.
I've applied a patch that corrects this problem in CVS HEAD, but since
it changes the behavior of HAVING in a nontrivial way, I'm inclined to
think that we should not backpatch it into existing release branches.
regards, tom lane