PostgreSQL Error 22036: non numeric sql json item

PostgreSQL error code 22036 (non numeric sql json item) occurs when a SQL/JSON path expression attempts to perform a numeric operation on a JSON item that is not a number — such as a string, boolean, array, or object. This error was introduced alongside the SQL/JSON Path feature in PostgreSQL 12 and typically surfaces in queries using jsonb_path_query, jsonb_path_exists, or the @@ and @? operators.

Top 3 Causes

1. Numeric Values Stored as Strings

The most common cause is JSON data where numbers are stored as quoted strings (e.g., "price": "100" instead of "price": 100). This frequently happens with data from external APIs or legacy systems that don't enforce type consistency.