Search Postgresql Archives

PL/Perl

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All!

I'm trying in 'plperl' forking the processes by 'fork' function,
but receiving this message

Warning: pg_exec(): Query failed: ERROR: creation of function failed: 'fork' trapped by operation mask at (eval 2) line 11.

Does it mean, that in 'plperl' I can't use 'fork' function???

function example
=================
CREATE OR REPLACE FUNCTION perl_fork_test ()
RETURNS int2
AS '
my %pid;
  
my @urls = (
  "http://domain1.com/index.php";,
  "http://domain2.com/index.php";
);
  
foreach my $url (@urls) {
  unless ($pid{$url} = fork) {
    my $html = qx/GET "$url"/;

    $ENV{TERM} = &my_exit;

    sub my_exit {
      exit(0);
    }
  }
}

sleep 6;
foreach my $url (keys %pid) {
  kill SIGTERM, $pid{$url};
}

wait;
  
return 1;
'
LANGUAGE 'plperl';
===================
VOLATILE
CALLED ON NULL INPUT
SECURITY INVOKER
===================

Thanx


---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux