42883ERRORTier 1 — Safe✅ HIGH confidencefunction does not exist
What this means
The query parser/planner could not find a function (or operator) with the given name and argument type signature in the current search_path. Postgres performs function resolution at parse time using the name and the types of all arguments.
Why it happens
- 1Misspelled function name
- 2Function exists in a different schema not in search_path
- 3Calling a function with incorrect argument types (Postgres overloads by signature)
- 4Required extension not installed (e.g., calling uuid_generate_v4() without uuid-ossp)
- 5Function was dropped or never created in this database
How to reproduce
A function is called with a wrong name or from a schema not in search_path.
SELECT uuid_generate_v4(); -- requires uuid-ossp extensionFix 1: Install the required extension
When the function is provided by an extension that is not yet installed.
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
SELECT uuid_generate_v4();
-- Or use the built-in alternative (Postgres 13+):
SELECT gen_random_uuid();Why this works
Extensions package functions, types, and operators. CREATE EXTENSION copies the extension's SQL objects into the current database's catalog. After installation, the functions are discoverable in the search_path and the planner can resolve them.
Fix 2: Check function signature and add explicit casts
When the function exists but is being called with the wrong argument types.
-- Find matching overloads:
SELECT proname, pg_get_function_arguments(oid)
FROM pg_proc
WHERE proname = 'my_function';
-- Call with explicit cast if needed:
SELECT my_function(42::BIGINT);Why this works
Postgres function overloading is resolved by matching argument types exactly (after implicit cast consideration). pg_proc stores all function signatures; querying it reveals which overloads exist and what argument types they expect.
What not to do
Add the function's schema to search_path permanently at the database level without review
Why it's wrong: Expanding search_path can cause name conflicts and unintended function shadowing from attacker-controlled schemas.
Version notes
Postgres 13+gen_random_uuid() is built-in; no extension needed for UUID generation.Sources
📚 Official docs: https://www.postgresql.org/docs/current/errcodes-appendix.html
📚 Feature docs: https://www.postgresql.org/docs/current/typeconv-func.html
🔧 Source ref: src/backend/parser/parse_func.c — ParseFuncOrColumn()
📖 Further reading: Function Type Resolution
Confidence assessment
✅ HIGH confidence
Stable and well-documented. Function resolution rules are consistent across supported versions. Edge case: operator functions (e.g., custom + operators) produce the same error code with a different message when no matching operator is found.
See also
📄 Reference pages