GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.postgresql.org — CREATE LANGUAGE November 19, 2026: PostgreSQL 19 Released!
Development Versions:
devel
This documentation is for an unsupported version of PostgreSQL.
You may want to view the same page for the current version, or one of the other supported versions listed above instead. CREATE LANGUAGENameCREATE LANGUAGE -- define a new procedural languageSynopsisCREATE [ TRUSTED ] [ PROCEDURAL ] LANGUAGE langname
HANDLER call_handler
DescriptionUsing CREATE LANGUAGE, a PostgreSQL user can register a new procedural language with a PostgreSQL database. Subsequently, functions and trigger procedures can be defined in this new language. The user must have the PostgreSQL superuser privilege to register a new language. CREATE LANGUAGE effectively associates the language name with a call handler that is responsible for executing functions written in the language. Refer to the Programmer's Guide for more information about language call handlers. Note that procedural languages are local to individual databases. To make a language available in all databases by default, it should be installed into the template1 database. Parameters
DiagnosticsCREATE This message is returned if the language is successfully created. ERROR: PL handler function funcname() doesn't exist This error is returned if the function funcname() is not found. NotesThis command normally should not be executed directly by users. For the procedural languages supplied in the PostgreSQL distribution, the createlang script should be used, which will also install the correct call handler. (createlang will call CREATE LANGUAGE internally.) Use the CREATE FUNCTION command to create a new function. Use DROP LANGUAGE, or better yet the droplang script, to drop procedural languages. The system catalog Table "pg_language" Attribute | Type | Modifier ---------------+---------+---------- lanname | name | lanispl | boolean | lanpltrusted | boolean | lanplcallfoid | oid | lancompiler | text | lanname | lanispl | lanpltrusted | lanplcallfoid | lancompiler -------------+---------+--------------+---------------+------------- internal | f | f | 0 | n/a C | f | f | 0 | /bin/cc sql | f | f | 0 | postgres At present, the definition of a procedural language cannot be changed once it has been created. ExamplesThe following two commands executed in sequence will register a new procedural language and the associated call handler. CREATE FUNCTION plsample_call_handler () RETURNS opaque
AS '$libdir/plsample'
LANGUAGE C;
CREATE LANGUAGE plsample
HANDLER plsample_call_handler;
CompatibilityCREATE LANGUAGE is a PostgreSQL extension. HistoryThe CREATE LANGUAGE command first appeared in PostgreSQL 6.3. See Alsocreatelang, CREATE FUNCTION, droplang, DROP LANGUAGE, PostgreSQL Programmer's Guide |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |