Postgresql Group By Concatenate Strings In Php