UPDATE table_name SET array_col = ARRAY(SELECT DISTINCT UNNEST(array_col) ORDER BY 1) where array_length(array_col, 1) > 1;