Brian Hirt <bhirt@mobygames.com> writes:
> I've run across a rather nasty bug in 8.1.2. It seems when the
> planer uses an index_scan within a GroupAggregate for a multi column
> index you can get incorrect results.
Patch is here if you need it before 8.1.3:
http://archives.postgresql.org/pgsql-committers/2006-01/msg00377.php
regards, tom lane