PostgreSQL throws ambiguous_function when it finds multiple functions that could match a call, so it cannot pick one.
ambiguous_function (PostgreSQL error 42725) means the database cannot decide which overloaded function to call because multiple signatures match the supplied arguments. Cast the arguments or schema-qualify the function name to resolve the ambiguity.
ambiguous_function
PostgreSQL raises error code 42725, named ambiguous_function, when the server cannot uniquely identify which overloaded function you are calling.
The message appears during SELECT, UPDATE, INSERT, or WHERE clauses that invoke a function or operator whose argument types permit more than one candidate signature.
Multiple overloaded functions with identical names and parameter counts leave the planner unsure which one matches the supplied literals or unknown types.
Implicit type coercion broadens the search space.
If PostgreSQL can automatically cast your arguments to several data types, several signatures look equally valid.
Schema search_path issues add ambiguity: the same function name exists in two schemas found early in search_path.
Cast each argument to an explicit type so the server matches a single signature.
Schema-qualify the function call when homonymous functions live in different schemas.
Drop or rename unused overloads to eliminate ambiguity entirely.
Calling length('abc') is ambiguous if you created length(text) and length(bytea).
Cast: length('abc'::text).
Custom sum(integer) in public conflicts with built-in sum(bigint). Use public.sum(1,2) or drop the duplicate.
Operators such as || rely on function overloading. Cast operands to avoid ambiguous operator errors that internally map to ambiguous_function.
Always cast literals in production code and never depend on unknown-type inference.
Keep the number of overloads small and purposeful.
Document each one and test unique invocation pathways.
In Galaxy, the editor’s inline linting flags ambiguous calls and suggests explicit casts before you run the query.
ambiguous_column (code 42702) occurs when two tables provide the same column name without qualification. Fix by prefixing the column with the table alias.
undefined_function (42883) fires when no overload matches at all. Correct by checking argument types or installing the required extension.
.
String or numeric literals default to type unknown until coerced. Several overloads then appear valid and the planner cannot choose.
If two schemas each contain myfunc(text), search_path order may expose both, creating ambiguity.
Libraries that register many versions of the same function increase the chances of overlapping signatures.
Many operators map to underlying functions.
When operand types are unclear, PostgreSQL surfaces ambiguous_function for the operator call.
.
No system switch exists. You must cast explicitly in each query or limit overloads.
Yes. PostgreSQL searches schemas in order. Identical functions earlier in the list can create ambiguity.
Only if existing queries rely on that exact signature. Audit call sites before removal.
Galaxy’s editor highlights ambiguous calls, suggests casts, and lets teams endorse corrected queries so errors do not reappear.