Postgresql Group By Concat String In C