pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Daulat Ram <Daulat.Ram@exponential.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: CREATE EXTENSION to load the language into the database
Date: Fri, 3 May 2019 09:50:45 -0700
Message-ID: <f419e6b8-deeb-a901-9f08-303097bba2a7@aklaver.com> (raw)
In-Reply-To: <BL0PR01MB5187121F2D79ACED865088DB9B350@BL0PR01MB5187.prod.exchangelabs.com>
References: <BL0PR01MB5187121F2D79ACED865088DB9B350@BL0PR01MB5187.prod.exchangelabs.com>

On 5/3/19 8:56 AM, Daulat Ram wrote:
> Hello team,
> 
> We are getting below issue while creating a function in Potsgres 11.2
> 
> nagios=# create or replace function diskf (filesystem text, warn int, 
> err int) returns text as $BODY$
> 
> nagios$# use warnings;
> 
> nagios$# use strict;
> 
> nagios$# my $fs = $_[0];
> 
> nagios$# my $w = $_[1];
> 
> nagios$# my $e = $_[2];
> 
> nagios$# my $r = "WARNING";
> 
> nagios$# my $output = `df -kP $fs`;
> 
> nagios$# $output =~ /.*\s+(\d+)%.*/;
> 
> nagios$# $output = $1;
> 
> nagios$# if ($output > $w)
> 
> nagios$# { $r = "ERROR" if $output > $e;}
> 
> nagios$# else { $r = "OK";}
> 
> nagios$# return  "$r $output";
> 
> nagios$# $BODY$ language plperlu;
> 
> ERROR:  language "plperlu" does not exist
> 
> HINT:  Use CREATE EXTENSION to load the language into the database.
> 
> nagios=# SELECT * FROM pg_language;
> 
> lanname  | lanowner | lanispl | lanpltrusted | lanplcallfoid | laninline 
> | lanvalidator | lanacl
> 
> ----------+----------+---------+--------------+---------------+-----------+--------------+--------
> 
> internal |       10 | f       | f            |             0 |         0 
> |         2246 |
> 
> c        |       10 | f       | f            |             0 |         0 
> |         2247 |
> 
> sql      |       10 | f       | t            |             0 |         0 
> |         2248 |
> 
> plpgsql  |       10 | t       | t            |         13075 |     13076 
> |        13077 |
> 
> (4 rows)
> 
> To solve this issue , I am getting the below warnings if creating 
> extensions.
> 
> nagios=# CREATE EXTENSION plperl;
> 
> ERROR:  could not open extension control file 
> "/usr/local/share/postgresql/extension/plperl.control": No such file or 
> directory
> 
> nagios=# CREATE LANGUAGE plperlu;
> 
> ERROR:  could not load library "/usr/local/lib/postgresql/plperl.so": 
> Error loading shared library libperl.so.5.20: No such file or directory 
> (needed by /usr/local/lib/postgresql/plperl.so)
> 
> nagios=# CREATE LANGUAGE plperlu;
> 
> ERROR:  could not load library "/usr/local/lib/postgresql/plperl.so": 
> Error loading shared library libperl.so.5.20: No such file or directory 
> (needed by /usr/local/lib/postgresql/plperl.so)

The plperl(u) extension has not been added to the Postgres installation. 
You need to do that. To help you with that we need to know:

What OS(and version) are you using?

How did you install Postgres?

> 
> nagios=#
> 
> Regards,
> 
> Dault
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





view thread (4+ messages)  latest in thread

Message-ID: <f419e6b8-deeb-a901-9f08-303097bba2a7@aklaver.com>
Permalink:  ../f419e6b8-deeb-a901-9f08-303097bba2a7@aklaver.com/
Also on:    postgresql.org/message-id/f419e6b8-deeb-a901-9f08-303097bba2a7@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, Daulat.Ram@exponential.com
  Subject: Re: CREATE EXTENSION to load the language into the database
  In-Reply-To: <f419e6b8-deeb-a901-9f08-303097bba2a7@aklaver.com>
  References: <BL0PR01MB5187121F2D79ACED865088DB9B350@BL0PR01MB5187.prod.exchangelabs.com> <f419e6b8-deeb-a901-9f08-303097bba2a7@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox