PL/Perl

Поиск
Список
Период
Сортировка
От ON.KG
Тема PL/Perl
Дата
Msg-id 1906385406.20050111145955@on.kg
обсуждение исходный текст
Ответ на PL/Perl  ("ON.KG" <skyer@on.kg>)
Ответы Re: PL/Perl  (Ragnar Hafstað <gnari@simnet.is>)
Re: PL/Perl  (Richard Huxton <dev@archonet.com>)
Re: PL/Perl  ("Joshua D. Drake" <jd@commandprompt.com>)
Список pgsql-general
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


В списке pgsql-general по дате отправления:

Предыдущее
От: Nirmalya Lahiri
Дата:
Сообщение: Private or publice function
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Private or publice function