This patch fixes the "Grouping error" that occurs on the index page when using PostgreSQL.
This error was due to the fact that when using COUNT and ORDER BY, pgSQL requires all the fields in ORDER BY clause to also appear in GROUP BY clause, so the COUNT request used to get the total number of items must be executed before adding the order parameters to the query builder.
This patch fixes the "Grouping error" that occurs on the index page when using PostgreSQL.
This error was due to the fact that when using COUNT and ORDER BY, pgSQL requires all the fields in ORDER BY clause to also appear in GROUP BY clause, so the COUNT request used to get the total number of items must be executed before adding the order parameters to the query builder.
Fixes issue #44