GroupSummary/Postgres: Fix group by in initial join query

refs #5896