Fix PostgreSQL array comparison function