I have created language plperlu in Postgres 9.3 (OS - UBUNTU 12.04.5), using below command
CREATE LANGUAGE plperlu;
I wanted to call shell script from postgres function So I written below function using plperlu.
Below is function
CREATE OR REPLACE FUNCTION tet_func (integer) RETURNS boolean
AS $$
$checkexitcode = system
("sh test_shell.sh");
if ($checkexitcode > 0) { return false; }
return true;
$$ LANGUAGE plperlu;
While compiling I am getting below error
ERROR: didn't get a CODE reference from compiling function "tet_func" CONTEXT: compilation of PL/Perl function "tet_func" ********** Error **********
ERROR: didn't get a CODE reference from compiling function "tet_func" SQL state: XX000 Context: compilation of PL/Perl function "tet_func"
Does anybody have idea why this error is occurring? Or anyone has other solution to call shell script from postgres function.