postgresqlubuntuplperl

CREATE LANGUAGE plperlu; fails despite postgresql-plperl-12 being installed


I'm on an Ubuntu-derived system (specifically pop_os from System76). I am trying to get Bucardo installed, but it appears to be failing because plperlu is not functional.

In a psql prompt:

# CREATE LANGUAGE plperlu;
ERROR:  could not access file "$libdir/plperl": No such file or directory

However, running:

$ pg_config --pkglibdir
/usr/lib/postgresql/12/lib

and:

$ ls /usr/lib/postgresql/12/lib/plperl*
/usr/lib/postgresql/12/lib/plperl.so

I do have the postgresql-plperl-12 package installed:

# apt install postgresql-plperl-12
Reading package lists... Done
Building dependency tree       
Reading state information... Done
postgresql-plperl-12 is already the newest version (12.7-0ubuntu0.20.10.1).
0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.

All the related errors I could find related either to the relevant package not being installed or the language not being created in postgres, so I'm a little stymied. The CREATE LANGUAGE statement's error appears to indicate that Postgres is looking for a file without an extension, but I'm not sure if that's fixable by a simple mv, and if so, who to report a package bug to.


Edit: Prompted by @AdrianKlaver's comment:

# CREATE EXTENSION plperlu;
ERROR:  could not open extension control file "/usr/share/postgresql/10/extension/plperlu.control": No such file or directory

... now why is it looking in /usr/share/postgresql/10/? I may be misinterpreting, but I have:

$ psql --version
psql (PostgreSQL) 12.7 (Ubuntu 12.7-0ubuntu0.20.10.1)

plperlu.control does exist in /usr/share/postgresql/12/extension/... but SELECT version() is indeed PostgreSQL 10.10... so something somewhere has gone wrong during an update. Does having a psql version that differs from the actualy postgres that is running cause issues?


Solution

  • The issue is that there are multiple versions of Postgres running as servers. Running pg_lsclusters will show what they are. The CREATE EXTENSION fails as the extension code for the version of Postgres that the command is being run on has not been installed.