Execute a Bash script (Shell Script) from postgres function/procedure/trigger
问题 CREATE or replace FUNCTION test() RETURNS boolean AS $$ $filename = '/home/postgres'; if (-e $filename) { exec /home/postgres/test.sh & return true; } return false; $$ LANGUAGE plperlu; exec /home/postgres/test.sh & its showing syntax error. Could you please help how to call bash script into postgres funtion/procedure 回答1: Presumably, the code needs to be syntactically valid Perl. So you'll need to clean up a few bits. CREATE or replace FUNCTION test() RETURNS boolean AS $$ my $filename = '