Running a SELECT on a partitioned table with a WHERE clause can result in the error "cache lookup failed for opclass 0".
The error is caused by a code bug in Planner when it tries to do partition pruning for the query.
The issue was introduced in 6.23 and is resolved in 6.27.3 and above.
Upgrade to 6.27.3 or above.