PostgreSQL: function is not unique
ERROR: function <name>(<args>) is not uniqueMore than one function matches your call after type resolution, so Postgres cannot choose. Cast the arguments so exactly one overload fits, or schema-qualify the function.
What this error means
When several overloaded functions could accept your arguments, often because the literals are untyped, Postgres cannot pick a single best match and refuses with a HINT to add explicit type casts.
It can also happen when two functions with the same name exist in different schemas on your search_path.
How to fix it
Ambiguous argument types
Cast the arguments so only one overload matches.
SELECT myfunc($1::numeric);Two functions share the name across schemas
Schema-qualify the call.
SELECT app.myfunc(1);How to avoid it next time
- Cast arguments to concrete types when calling overloaded functions.
- Avoid defining functions with the same name in multiple schemas on the path.
Frequently asked questions
What does 'Could not choose a best candidate function' mean?
It is the HINT: several overloads match your arguments equally. Add casts so one is the clear match.
How is this different from 'function does not exist'?
That means no overload matches. This means more than one matches and Postgres cannot choose.
Stop struggling with SQL
Use FluentDB, the AI database client for macOS.
Related errors
Part of the PostgreSQL error reference. Last reviewed 2026-07-31.