Postgresql Count Distinct Elements In An Array