Fix PostgreSQL array type casting