Postgres is pedantic when it comes to GROUP BY queries and demands that all selected columns that aren't used with an aggregate function be in the GROUP BY clause, even if the GROUP BY already covers a unique index (meaning grouping by more columns would have no effect).
MySQL is more flexible, causing developers to write queries that fail on Postgres for this reason. Instead of developers having to go through a lot of trouble to construct GROUP BY clauses with the right columns with the ORDER BY columns at the beginning (r68100), the database layer should do this for them.
Because the semantics of GROUP BY described here are actually in the SQL standard IIRC, there's likely to be more DB backends, so I think this should be implemented in DatabaseBase::makeSelectOptions() with DB backends needing this functionality overriding needsAllColumnsInGroupBy() or whatever to return true.
Version: 1.17.x
Severity: enhancement