Postgresql Group By Concatenate Strings Python