Chapter 40. PL/Perl - Perl Procedural Language

Table of Contents
40.1. PL/Perl Functions and Arguments
40.2. Data Values in PL/Perl
40.3. Built-in Functions
40.3.1. Database Access from PL/Perl
40.3.2. Utility Functions in PL/Perl
40.4. Global Values in PL/Perl
40.5. Trusted and Untrusted PL/Perl
40.6. PL/Perl Triggers
40.7. PL/Perl Under the Hood
40.7.1. Configuration
40.7.2. Limitations and Missing Features

Note: The following description applies both to Postgres-XC and PostgreSQL if not described explicitly.

PL/Perl is a loadable procedural language that enables you to write PostgreSQL functions in the Perl programming language.

The main advantage to using PL/Perl is that this allows use, within stored functions, of the manyfold "string munging" operators and functions available for Perl. Parsing complex strings might be easier using Perl than it is with the string functions and control structures provided in PL/pgSQL.

To install PL/Perl in a particular database, use CREATE EXTENSION plperl, or from the shell command line use createlang plperl dbname.

Tip: If a language is installed into template1, all subsequently created databases will have the language installed automatically.

Note: Users of source packages must specially enable the build of PL/Perl during the installation process. (Refer to Chapter 15 for more information.) Users of binary packages might find PL/Perl in a separate subpackage.