25.2. Building and Installing

In order to build and install PL/Perl if you are installing PostgreSQL from source then the --with-perl must be supplied to the configure script. PL/Perl requires that, when Perl was installed, the libperl library was build as a shared object. At the time of this writing, this is almost never the case in the Perl packages that are distributed with the operating systems. A message like this will appear during the build to point out this fact:

*** Cannot build PL/Perl because libperl is not a shared library.
*** You might have to rebuild your Perl installation.  Refer to
*** the documentation for details.

Therefore it is likely that you will have to re-build and install Perl manually to be able to build PL/Perl.

When you want to retry to build PL/Perl after having reinstalled Perl, then change to the directory src/pl/plperl in the PostgreSQL source tree and issue the commands

gmake clean
gmake all
gmake install

The createlang command is used to install the language into a database.

$ createlang plperl template1

Alternatively, to create untrusted interpreter (where functions can only be created by a superuser, but the functions are not restricted), use:

$ createlang plperlu template1

If it is installed into template1, all future databases will have the language installed automatically.