SQLSTATE 42883 ERROR Class 42: Syntax Error or Access Rule Violation

undefined_function function … does not exist — 42883

PostgreSQL error "function … does not exist" (SQLSTATE 42883): what it means, common causes, and how to fix it.

PG 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed May 2025 Grounded in source

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 HINT usually 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

  1. Add explicit casts to match a real signature: SELECT lower(42::text);.
  2. Install the extension if needed: CREATE EXTENSION pg_trgm; (etc.).
  3. List candidate signatures: \df lower in psql.
  4. Schema-qualify or fix search_path if 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”.

Was this helpful?