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

undefined_object language “…” does not exist — 42704

PostgreSQL error "language "…" does not exist" (SQLSTATE 42704): 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

A function or statement referenced a procedural language that is not installed. PostgreSQL raises SQLSTATE 42704 (undefined_object).

  • The named language isn’t available in this database.
  • Common when creating a function in plpython/plperl without the extension.
  • Languages are installed per database.

What the server log shows

ERROR:  language "plpython3u" does not exist
HINT:  Use CREATE EXTENSION to load the language into the database.

Why PostgreSQL raises this — what the manual says

the CREATE LANGUAGE reference (Description):

“CREATE LANGUAGE effectively associates the language name with handler function(s) that are responsible for executing functions written in the language.”

Procedural languages must be loaded into a database before functions can use them. Referencing one that isn’t installed cannot be resolved, so PostgreSQL reports 42704.

Common causes

  • The language extension wasn’t installed in this database.
  • A typo in the language name.
  • The language package isn’t present on the server.

How to fix it

  1. Install it: CREATE EXTENSION plpython3u; (requires the OS package).
  2. List languages: \dL or query pg_language.
  3. Confirm the language package is installed on the server.

Related & next steps

Reference: PostgreSQL 18 — CREATE LANGUAGE.

Was this helpful?