14th September 2023: PostgreSQL 16 Released!
Unsupported versions: 7.0
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.

Chapter 12. PL/perl - Perl Procedural Language

This chapter describes how to compile, install and use PL/Perl.


PL/Perl allows you to write functions in the Perl scripting language which may be used in SQL queries as if they were built into Postgres.

The PL/Perl intepreter is a full Perl interpreter. However, certain operations have been disabled in order to increase the security level of the system.

In general, the operations that are restricted are those that interact with the environment. This includes filehandle operations, require, and use (for external modules).

It should be noted that this security is not absolute. Indeed, several Denial-of-Service attacks are still possible - memory exhaustion and endless loops are two.