linkend="app-createlang"> can be used to do this from the shell
command line. For example, to install the language
-
PL/pgSQL into the database
+
PL/Perl into the database
template1>, use:
-createlang plpgsql template1
+createlang plperl template1
The manual procedure described below is only recommended for
installing custom languages that CREATE LANGUAGE
shows how the manual
installation procedure would work with the language
-
Manual Installation of PL/pgSQL
+
Manual Installation of PL/Perl
- The following command tells the database server where to find the
- shared object for the
PL/pgSQL language's call handler function.
+ The following command tells the database server where to find the
+ shared object for the
PL/Perl language's call
+ handler function:
-CREATE FUNCTION plpgsql_call_handler() RETURNS language_handler AS
- '$libdir/plpgsql' LANGUAGE C;
+CREATE FUNCTION plperl_call_handler() RETURNS language_handler AS
+ '$libdir/plperl' LANGUAGE C;
-
PL/pgSQL has an inline handler function
+
PL/Perl has an inline handler function
and a validator function, so we declare those too:
-CREATE FUNCTION plpgsql_inline_handler(internal) RETURNS void AS
- '$libdir/plpgsql' LANGUAGE C;
+CREATE FUNCTION plperl_inline_handler(internal) RETURNS void AS
+ '$libdir/plperl' LANGUAGE C;
-CREATE FUNCTION plpgsql_validator(oid) RETURNS void AS
- '$libdir/plpgsql' LANGUAGE C;
+CREATE FUNCTION plperl_validator(oid) RETURNS void AS
+ '$libdir/plperl' LANGUAGE C;
The command:
-CREATE TRUSTED PROCEDURAL LANGUAGE plpgsql
- HANDLER plpgsql_call_handler
- INLINE plpgsql_inline_handler
- VALIDATOR plpgsql_validator;
+CREATE TRUSTED PROCEDURAL LANGUAGE plperl
+ HANDLER plperl_call_handler
+ INLINE plperl_inline_handler
+ VALIDATOR plperl_validator;
then defines that the previously declared functions
should be invoked for functions and trigger procedures where the
- language attribute is plpgsql.
+ language attribute is plperl.
In a default
PostgreSQL installation,
the handler for the
PL/pgSQL language
is built and installed into the library
- directory. If
Tcl> support is configured in, the handlers
- for
PL/Tcl> and PL/TclU> are also built and
- installed in the same location. Likewise, the
PL/Perl> and
-
PL/PerlU> handlers are built and installed if Perl support
- is configured, and the
PL/PythonU> handler is
- installed if Python support is configured.
+ directory; furthermore, the
PL/pgSQL language
+ itself is installed in all databases.
+ If
Tcl> support is configured in, the handlers for
+
PL/Tcl> and PL/TclU> are built and installed
+ in the library directory, but the language itself is not installed in any
+ database by default.
+ Likewise, the
PL/Perl> and PL/PerlU>
+ handlers are built and installed if Perl support is configured, and the
+
PL/PythonU> handler is installed if Python support is
+ configured, but these languages are not installed by default.