Chapter 11. PL/Perl – Perl Procedural Language
Perl is a feature-rich language, which has been around for a long time. PostgreSQL allows you to write Perl routines that are stored and executed inside the database. This ability is quite unique to PostgreSQL and allows you to do a lot of cool things, such as using Perl's text manipulation features inside a database. PL/Perl is one of the many languages that PostgreSQL supports for writing server-side routines.
As discussed in the earlier chapters, PostgreSQL supports trusted and untrusted languages. PL/Perl is available in both these flavors. The trusted version runs inside a safe container and, therefore, not the entire set of familiar native Perl operations is allowed.
In this chapter, we will cover the following topics:
- When to use PL/Perl
- How to install and write a basic function
- Passing arguments to and from PL/Perl functions
- Writing triggers in PL/Perl
- A brief introduction to untrusted PL/Perl