Resolve postgresql incompatible SQL

reference change 6f3dabc and e83890f
Primary issue appears to be caused by MySQL extensions to "GROUP BY",
as per http://dev.mysql.com/doc/refman/5.0/en/group-by-extensions.html
Added 3.0.1.sql update for postgresql
Merge branch 'postgres-fix' of https://github.com/kwirk/eventgallery