Postgresql Count Distinct Elements In List