Error code

PostgreSQL 22P02

POSTGRESQL22P02
Database Error Code· An error code returned by a database server such as PostgreSQL or MySQL.

What it means

invalid_text_representation — a string could not be parsed into the target type.

How to fix it

  1. Validate and sanitize user-supplied input before binding it to the query.
  2. Use parameterized queries and let the driver handle type conversion.
  3. Check that CSV or JSON data being loaded matches the expected column types.

Not affiliated with PostgreSQL. Answer summarized from the manufacturer's manual linked above; consult that source for the authoritative procedure.