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 1hMbOl-0001Xa-UK for pgsql-general@arkaria.postgresql.org; Fri, 03 May 2019 16:51:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hMbOk-0004tx-Hr for pgsql-general@arkaria.postgresql.org; Fri, 03 May 2019 16:50:58 +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 1hMbOk-0004sn-53 for pgsql-general@lists.postgresql.org; Fri, 03 May 2019 16:50:58 +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 1hMbOg-00074D-Rr for pgsql-general@lists.postgresql.org; Fri, 03 May 2019 16:50:57 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id F243B265D7; Fri, 3 May 2019 12:50:53 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Fri, 03 May 2019 12:50:53 -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=S Of2qDVEr8BNMCsNQrNoJNrbVLUuzLB7gDot352AXow=; b=IsMhSw0oF+FKyRpDj cV5otFlmLUnfQLwiRqvzxm4jOHPLHmaHB/rIwyXPddCd9E+NnG3R6m3wbs/tEzUy 4vRNJbMVR/O6PwBCT/0R1l/wBIRe+7w/jJQTsBcw6oynUnklf4zQERKWlkaF11RO EEFd2ZePnra+MTd2QFsIQmd6AUL1oJOkUOlZRfFG+VudMycsu9p7Eah7NsaOaNM1 p+I9Nbwbe0Thq9Z/Z+b30KS4bseNVP4iDKs79NuR+2fmNzskzdLBuiQjOu+pLght TPRSF3uwgxT/EtibzPOt7NVdOJYSaTviD6AJhhq8NsF/lvkZxOwY8/KGPQHSKtNI NMyLA== 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=SOf2qDVEr8BNMCsNQrNoJNrbVLUuzLB7gDot352AX ow=; b=G8aM9iOWaS+3uUJ7EpIaPxBUXPBzHxB4M9raGKktCa58lmMG+oMNAzDkg 4OG6z8H4clhTkAYU7MoTe2QQq86ShKhu449Q+uyKugH6f9v+alFlTI+c609LTyKy mdXocMSnxogR8WbUUKGwvLJ/RS9jXcEF65vAEbsFE8TBIpIeZxsGs02WMOUAD3yN ZvIyFMWksftHKWJxxhknVmnjs0uYkkW9bvIEkNZU5lbpxBondQy1DdOKp5kqo8fc YBhVBsmbYQi7c+xgjZmevyYBR02oaZMKqNOgqamWvkzIHmJEzKL1sxuDZcozBcCp NHVxdH9iv7vKFf2yYrn6UQegZBiCw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduuddrjedugdduuddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefheenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucfkphepudejvddrheekrdegtddrudegnecurfgrrhgrmhepmhgrihhlfhhrohhm pegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsthgvrh fuihiivgeptd X-ME-Proxy: Received: from ranger.suse (unknown [172.58.40.14]) by mail.messagingengine.com (Postfix) with ESMTPA id 40AB8E44A1; Fri, 3 May 2019 12:50:52 -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: Date: Fri, 3 May 2019 09:50:45 -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=windows-1252; 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 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