Diagnostic Queries
Symptoms
No function matches the name and argument types you called. In PostgreSQL functions are resolved by name plus the types of their arguments, so a function can “not exist” even when one with that name does — if the argument types don’t match a known signature.
- The statement aborts with SQLSTATE 42883.
- A
HINTusually suggests adding an explicit type cast. - Also occurs when an extension that defines the function isn’t installed.
What the server log shows
ERROR: function lower(integer) does not exist
LINE 1: SELECT lower(42);
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
STATEMENT: SELECT lower(42);
Why PostgreSQL raises this — what the manual says
As Section 10.3 Functions explains:
No function matched the given name and argument types; PostgreSQL resolves a function call against the set of candidate functions of that name, and when none fits exactly it tries to find a best match by applying implicit casts — if that also fails, the call is rejected, so you may need to add an explicit cast on the arguments.
Function resolution matches the name and tries to coerce the supplied argument types to a known signature. When no exact or coercible match exists, PostgreSQL raises 42883 and usually hints that an explicit cast is needed. A missing extension that defines the function produces the same error.
Common causes
- Calling a function with the wrong argument types (the HINT suggests a cast).
- An extension that provides the function is not installed.
- A typo in the function name, or wrong schema/search_path.
- Relying on an implicit cast PostgreSQL no longer performs.
How to fix it
- Add explicit casts to match a real signature:
SELECT lower(42::text);. - Install the extension if needed:
CREATE EXTENSION pg_trgm;(etc.). - List candidate signatures:
\df lowerin psql. - Schema-qualify or fix
search_pathif the function is in another schema.
Diagnostic query
-- Show all overloads of a function name
SELECT oid::regprocedure AS signature
FROM pg_proc
WHERE proname = 'lower';
Compare your call’s argument types against these signatures.
Related & next steps
Reference: PostgreSQL 18 Section 10.3 “Functions”.
Thanks — noted. This helps keep the database accurate.