Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMccu-0004qZ-O9 for pgsql-general@arkaria.postgresql.org; Fri, 03 May 2019 18:09:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hMccs-0005dm-Dv for pgsql-general@arkaria.postgresql.org; Fri, 03 May 2019 18:09:38 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMccq-0005HV-BI for pgsql-general@lists.postgresql.org; Fri, 03 May 2019 18:09:38 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMccm-0000M0-Ov for pgsql-general@lists.postgresql.org; Fri, 03 May 2019 18:09:35 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id AD8CA245B1; Fri, 3 May 2019 14:09:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 03 May 2019 14:09:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=P HskCKIj0L5nZ2bEvK2/ZjBE35skEzMP/ZtNlxdRQBA=; b=sFWRHgcqAY/oKfsMp U83SXFUl16i/pmaa3Pz0rbHD1qY4iS8Nk5FzDBraMbII4WM4IUfLEBFMt4TlNyIC gxW1A91AUvqcG/plqjsVKkqn+hCdvoQqt1FKQyQ/RcEC88vLcBI/Nb2mP4w6noAl T64wJ5jOnyDrEF+hYkhv7rdYSC/YY86qBl7LyuTxqQegQiVaZxGSwlldeMLMljLv GEMpmFMlOf3HhD8ml67aAoeTXdyn/hwq1ZKgJ7nkv2u0h4JB9R5N10DwyNLLc4Ai 28EfS45JBQGujgFM6Zqjl8NfWk4en5bJMPKnY6SNqhp1yCZiNVHX7QgrlM2993xV +HCZg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=PHskCKIj0L5nZ2bEvK2/ZjBE35skEzMP/ZtNlxdRQ BA=; b=azYWT4OQiAKXUK1mjMZWbea0eww0rqcmisG0ApeFqrS/1bABStpN5nGKj jly3RHolJVuq9TTUxhgYvp53Z/yAeuNzHY0KM7ZEMIVhzgEvnWI17uM+6nzNRdfp ohFs7Q6e0e1TWN4k1R57sM9UrUpdA8CpSi+9FgnqPWwQfqmIQV20jUH/uWYCMxHO IxKaUtnyCj12E/vnBP2uW9dbQw8qdHruIYk0AnIUdV0jZGNW/KEcEDw0ytT/G388 O+82YJ9zs7NMncBGJRbejH/FfnYJXmZt95SZ2rug+5XRiAj4fOgxDG9s53Ex23u3 qhk+cy123gHMwH4dEdhEJJWUBc8og== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrjedugdduvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucffohhmrghinheprghlphhinhgvlhhinhhugidrohhrghdpphhoshhtghhrvghs qhhlrdhorhhgnecukfhppedujedvrdehkedrgedtrddutdefnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuvehl uhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from ranger.suse (unknown [172.58.40.103]) by mail.messagingengine.com (Postfix) with ESMTPA id 34CDCE4649; Fri, 3 May 2019 14:09:22 -0400 (EDT) Subject: Re: CREATE EXTENSION to load the language into the database To: Daulat Ram , "pgsql-general@lists.postgresql.org" References: From: Adrian Klaver Message-ID: <0a6b7e1c-68fe-e6ed-74ee-472c98bee6c9@aklaver.com> Date: Fri, 3 May 2019 11:09:13 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 5/3/19 10:24 AM, Daulat Ram wrote: > Hi Adrian, > > Please find the requested details. > > What OS(and version) are you using? > Ans: > bash-4.4$ cat /etc/os-release > NAME="Alpine Linux" > ID=alpine > VERSION_ID=3.9.2 > PRETTY_NAME="Alpine Linux v3.9" > HOME_URL="https://alpinelinux.org/" > BUG_REPORT_URL="https://bugs.alpinelinux.org/" > bash-4.4$ > > > bash-4.4$ uname -a > Linux psql_primary_kbcn 3.10.0-514.16.1.el7.x86_64 #1 SMP Wed Apr 12 15:04:24 UTC 2017 x86_64 Linux > bash-4.4$ > > > How did you install Postgres? > > Ans: > > We did installation via customized docker image provided by our dev ops team. Well in the image they need to make the plperl language available. If they are building from source then it needs to be compiled with: https://www.postgresql.org/docs/11/install-procedure.html --with-perl Build the PL/Perl server-side language. If they are using packages then they will need to include the appropriate package. > > Regards, > Daulat > > > -----Original Message----- > From: Adrian Klaver > Sent: Friday, May 3, 2019 10:21 PM > To: Daulat Ram ; pgsql-general@lists.postgresql.org > Subject: Re: CREATE EXTENSION to load the language into the database > > 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 > -- Adrian Klaver adrian.klaver@aklaver.com