Postgresql Find Duplicate Values In Array Function