Re: Limitations in PL/perl

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Limitations in PL/perl
Дата
Msg-id 3E77FF14.3080607@joeconway.com
обсуждение исходный текст
Ответ на Limitations in PL/perl  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-general
Josh Berkus wrote:
> Is there any documentation anywhere on what subset of Perl functionality is
> supported by PL/perl?   I've had a lot of annoying trial-and-error sessions
> lately where I'll try something that works on the command line only to find
> out that it silently fails in PL/perl.
[...snip...]
> Or is this maybe a problem with the version of Perl installed on the DB
> server?

I think it is probably a problem with the version of Perl installed on
the DB server. As far as I can see, plperl just runs a perl interpreter
using whatever perl shared library it finds. That is except plperl (as
compared to plperlu) runs a "safe" interpreter with certain
functionality disabled -- but I don't know the details of what is disabled.

I can see this in the source:
plperl_init_interp(void)
{
   char       *embedding[3] = {
     "", "-e",
     /*
      * no commas between the next 5 please. They are supposed to be
      * one string
      */
     "require Safe; SPI::bootstrap();"
     "sub ::mksafefunc { my $x = new Safe;
      $x->permit_only(':default');$x->permit(':base_math');"
     "$x->share(qw[&elog &DEBUG &LOG &INFO &NOTICE &WARNING &ERROR]);"
     " return $x->reval(qq[sub { $_[0] }]); }"
     "sub ::mkunsafefunc {return eval(qq[ sub { $_[0] } ]); }"
   };

Not sure if that helps.

Joe


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Division of intervals.
Следующее
От: James Gregory
Дата:
Сообщение: retrieving fields in plpgsql