PostgreSQL error: language "plperlu" does not exist

14.6k Views Asked by At

I am a beginner with PostgreSQL. I got a SQL patch of PostgreSQL and while executing the SQL to configure it at my end. I am getting following error. My background is MySQL.

Query

CREATE FUNCTION wine_entry_script() RETURNS trigger
    LANGUAGE plperlu AS
$$
   #!/usr/bin/perl -w
   use strict;
   require ('/var/lib/pgsql/data/Trigger_Processor1.0.pl');
$$;

Error

ERROR: language "plperlu" does not exist SQL state: 42704 Hint: Use CREATE LANGUAGE to load the language into the database.

3

There are 3 best solutions below

4
On BEST ANSWER

plperlu is the untrusted version of PL/Perl (plperl). It is one of the prepared choices in PostgreSQL. Have a look:

SELECT * FROM pg_language;

To use it, run once per database:

CREATE LANGUAGE plperlu;

You must be superuser to install any additional language. You must be superuser to use untrusted languages. Be aware of security implications! More in the manual.

Most Linux systems come with Perl installed. Under Windows, make sure that some flavor of Perl is installed in your system (providing the required DLL files) before you can create the language.

Related:

0
On

create the extension and then the language.

CREATE EXTENSION plperl;
CREATE LANGUAGE plperlu;
0
On

First you install plperl in your server by below command

sudo apt install postgresql-plperl-13

(Change 13 with your current version)

now login with postgres

sudo su - postgres

Now you login with database which require this extension

psql -d nameofdatabase

CREATE EXTENSION plperl;

CREATE LANGUAGE plperlu;

Now its ready for use