PostgreSQL 22P02: invalid input syntax for type integer/uuid
String literal could not be cast to the target column data type.
Runs locally in browser
Free · No login
Independently Verified 2026-11-25
v4.0.0
Identifier: PostgreSQL 22P02: invalid input syntax for type integer/uuid
Platform: PostgreSQL
Interactive Diagnostic Checklist
Safe Diagnostic Command:
SELECT pg_typeof(col) FROM tbl LIMIT 1;
Technical Explanation
String literal could not be cast to the target column data type. Verified technical resolution: Validate input types before binding SQL parameters; avoid passing empty strings for integer/UUID columns.
Worked Examples
- Diagnostic check: SELECT pg_typeof(col) FROM tbl LIMIT 1;
Limitations & Assumptions
- Confirm exact software version and execution layer before applying configuration changes in production.
Source References & Verification
Resource ID: err-pg-22p02-invalid-text-representation · Independently verified: 2026-11-25