PostgreSQL Error 42883: Function Does Not Exist
Troubleshoot PostgreSQL SQLSTATE 42883 by checking function names, schemas, search_path, argument types, and procedure calls.
On this page
PostgreSQL SQLSTATE 42883 is undefined_function. It means PostgreSQL could not resolve a callable routine matching the name and argument types in the current database. The message commonly says function name(type, ...) does not exist; it may also say operator does not exist. See the PostgreSQL 18 error-code appendix.
Read the full error text and note the routine name, argument types, and schema (if shown). PostgreSQL distinguishes a missing function from a missing column (42703); see Error 42703 troubleshooting.
Confirm the routine name, schema, and signature
Function names without double quotes are folded to lowercase when created or called. Double-quoted mixed-case names must be spelled and quoted exactly. A function can also exist in another schema or under a different overload. Check the current connection and list same-named routines:
SELECT current_database(), current_user, current_setting('search_path');
SELECT
n.nspname AS schema_name,
p.proname AS routine_name,
CASE p.prokind
WHEN 'p' THEN 'procedure'
WHEN 'a' THEN 'aggregate'
WHEN 'w' THEN 'window function'
ELSE 'function'
END AS routine_kind,
pg_get_function_identity_arguments(p.oid) AS argument_types
FROM pg_proc AS p
JOIN pg_namespace AS n ON n.oid = p.pronamespace
WHERE p.proname = 'calculate_total'
ORDER BY n.nspname, argument_types;
Replace calculate_total with the exact name from the error. Unquoted names are stored in lowercase, while quoted names preserve their case. If the result shows a function in another schema, try a schema-qualified call, for example SELECT app.calculate_total(...). If no matching routine appears, check whether the migration or extension that creates it ran in this database.
For a specific function signature, to_regprocedure returns the routine identity if it resolves and NULL otherwise:
SELECT to_regprocedure('app.calculate_total(integer, text)');
Function names are resolved through the active search_path when they are not schema-qualified. See PostgreSQL’s schema search path documentation and function type resolution rules.
Compare the supplied argument types
PostgreSQL chooses an overload using the function name and the types of the supplied arguments. It may apply implicit casts, but it does not convert every type automatically. For example, PostgreSQL has substr(text, integer), not substr(integer, integer):
SELECT substr(1234, 3);
-- ERROR: function substr(integer, integer) does not exist
SELECT substr(1234::text, 3);
Cast an argument only when the conversion matches the intended behavior. Check the full signature in the query above or inspect the function definition; do not create a new overload solely to silence an error without confirming the correct input and output types.
Check whether you are calling a procedure or a function
Functions are called in expressions, such as SELECT app.calculate_total(...). Procedures are invoked with CALL, for example:
CALL app.refresh_summary();
If the routine was created with CREATE PROCEDURE, calling it as a function will not match. Confirm the routine kind in pg_proc and use the corresponding invocation syntax. PostgreSQL documents CALL separately from function calls.
Distinguish a missing routine from a privilege error
42883 means PostgreSQL could not resolve the requested routine signature. If the routine exists but the current role lacks permission, the server normally reports 42501 (insufficient_privilege); see Error 42501 troubleshooting. If it reports a missing column instead, see Error 42703.
If the function resolves but an expression or query combines incompatible input types, see Error 42804: datatype mismatch. For other SQLSTATE guides, browse PostgreSQL Error Troubleshooting.