ERROR: invalid input syntax for type integer: "abc"
A string couldn’t be converted to the column’s type (integer, numeric, boolean, date…).
Seen on:
PostgreSQL
Meaning
Empty strings, "undefined"/"null" strings from JavaScript, or text in numeric columns. PostgreSQL never treats '' as NULL.
Common causes
- Empty string '' for numeric columns
- "undefined" from a frontend
- Wrong parameter order in queries
⚡ Quick fix
- Send NULL instead of ''
- Validate/parse input before querying
- Check parameter positions
Detailed fix by platform
PostgreSQL
INSERT INTO items (qty) VALUES (NULLIF($1, '')::int);
How to diagnose
- Value — Quoted in the message
- Column — Expected type
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026