fixing .group for postgresql.