Re: plperl and regexps with accented characters - incompatible?

Поиск
Список
Период
Сортировка
От Greg Sabino Mullane
Тема Re: plperl and regexps with accented characters - incompatible?
Дата
Msg-id e7c1e5796355633ce8255c7ad0c2ef48@biglumber.com
обсуждение исходный текст
Ответ на plperl and regexps with accented characters - incompatible?  (hubert depesz lubaczewski <depesz@depesz.com>)
Ответы Re: [HACKERS] plperl and regexps with accented characters - incompatible?  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160



hubert depesz lubaczewski writes:
...
> return (shift =~ /[a-z0-9_-]+/i) || 0;
...
> 'require' trapped by operation mask at line 15.
>
> it looks strange - what "require"?

As you guessed, it's trying to do load the utf8 pragma, and failing
as 'require' (and 'use') are not allowed by default: plperl uses the
Safe module to disallow things like 'require Module;'. Unfortunately, the
only way around it on your end is to use plperlu - something I recommend
anyway (for other reasons).

> also - perhaps loading of this particular module should be allowed even in
> plperl? otherwise it requires me to use plperlu for even the simple task of
> regexp matching.

Yes, we might want to consider making utf8 come pre-loaded for plperl. There
is no direct or easy way to do it (we don't have finer-grained control than
the 'require' opcode), but we could probably dial back restrictions,
'use' it, and then reset the Safe container to its defaults. Not sure what
other problems that may cause, however. CCing to hackers for discussion
there.

- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200711121139
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iD8DBQFHOIJPvJuQZxSWSsgRA10hAJ996hZYM8KiuziJb/R2QX0HY754bwCg+xZN
kePHNNZbLtRXj6ko8j51waw=
=fw0v
-----END PGP SIGNATURE-----



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

Предыдущее
От: "Charles Mortell"
Дата:
Сообщение: update record with two-column primary key
Следующее
От: David Fetter
Дата:
Сообщение: Re: reverse strpos?