ERROR: operator does not exist: text = integer LINE 1: ...rmla_scores WHERE (split_part(course_code,'_',1)) = -1 ORDER... ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.