Software: Apache/2.2.22 (Debian). PHP/5.6.36 uname -a: Linux h05.hvosting.ua 4.9.110-amd64 #3 SMP Sun Nov 4 16:27:09 UTC 2018 x86_64 uid=1389(h33678) gid=1099(h33678) groups=1099(h33678),502(mgrsecure) Safe-mode: OFF (not secure) /usr/share/doc/postgresql-doc-9.1/html/ drwxr-xr-x |
Viewing file: Select action/file-type:
38.1. Installing Procedural LanguagesA procedural language must be "installed" into each database where it is to be used. But procedural languages installed in the database template1 are automatically available in all subsequently created databases, since their entries in template1 will be copied by CREATE DATABASE. So the database administrator can decide which languages are available in which databases and can make some languages available by default if he chooses. For the languages supplied with the standard distribution, it is only necessary to execute CREATE EXTENSION language_name to install the language into the current database. Alternatively, the program createlang can be used to do this from the shell command line. For example, to install the language PL/Perl into the database template1, use: createlang plperl template1 The manual procedure described below is only recommended for installing languages that have not been packaged as extensions. Manual Procedural Language Installation A procedural language is installed in a database in five steps, which must be carried out by a database superuser. In most cases the required SQL commands should be packaged as the installation script of an "extension", so that CREATE EXTENSION can be used to execute them.
Example 38-1 shows how the manual installation procedure would work with the language PL/Perl. Example 38-1. Manual Installation of PL/Perl The following command tells the database server where to find the shared object for the PL/Perl language's call handler function: CREATE FUNCTION plperl_call_handler() RETURNS language_handler AS '$libdir/plperl' LANGUAGE C;
PL/Perl has an inline handler function and a validator function, so we declare those too: CREATE FUNCTION plperl_inline_handler(internal) RETURNS void AS '$libdir/plperl' LANGUAGE C; CREATE FUNCTION plperl_validator(oid) RETURNS void AS '$libdir/plperl' LANGUAGE C STRICT;
The command: 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 plperl. In a default PostgreSQL installation, the handler for the PL/pgSQL language is built and installed into the "library" 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. |
:: Command execute :: | |
--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by PinoyWH1Z | C99Shell Github | Generation time: 0.0258 ]-- |