ERROR: could not determine data type of parameter $1
PostgreSQL can’t infer a parameter’s type from context (e.g. $1 IS NULL or SELECT $1).
Seen on:
PostgreSQL
Meaning
Parameters used without a typed comparison need an explicit cast.
Common causes
- $1 IS NULL checks
- Parameters in SELECT lists
- Optional filter patterns (col = $1 OR $1 IS NULL)
⚡ Quick fix
- Cast the parameter: $1::text, $1::int
- Build the filter in application code instead of the OR-IS-NULL pattern
Detailed fix by platform
PostgreSQL
WHERE ($1::text IS NULL OR email = $1::text)
How to diagnose
- Parameter — Which $n lacks context?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 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