PL/Perl is one of the foreign languages available for PostgreSQL. It implements a Perl 5 environment in order to allow executable code to be interpreted as a Perl 5 program. This makes it possible to write functions, procedures, and other related executable units (such as triggers) in Perl.
There are two variants of PL/Perl, which are:
- A trusted version, named plperl
- An untrusted version, named plperlu
The trusted version cannot interact with Operating System resources (such as opening files and sockets), nor can it load external modules (by means of require or use). This makes it suitable for every non-administrator role. On the other hand, the untrusted version can exploit full Perl features, including loading external modules and interacting with Operating System resources. However, by default, its usage is limited to database administrators, because a malicious plperlu...