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
- Install it:
CREATE EXTENSION plpython3u;(requires the OS package). - List languages:
\dLor querypg_language. - Confirm the language package is installed on the server.
Related & next steps
Reference: PostgreSQL 18 — CREATE LANGUAGE.
Thanks — noted. This helps keep the database accurate.