Re: Workaround to get arrays for plperl

Поиск
Список
Период
Сортировка
От CaT
Тема Re: Workaround to get arrays for plperl
Дата
Msg-id 20080330132718.GD4736@zip.com.au
обсуждение исходный текст
Ответ на Workaround to get arrays for plperl  (<Eugen.Konkov@aldec.com>)
Список pgsql-bugs
On Sun, Mar 30, 2008 at 04:23:07PM +0300, Eugen.Konkov@aldec.com wrote:
> It seems that function get arrays as strings in plperl.
> This is a little workaround who want pass arrays to plperl functions
>
> my( $strarr )= @_;
> $strarr =~ s/{/[/g;
> $strarr =~ s/}/]/g;
> my $arr= eval $strarr;
>
> NOTICE:
> you must create you function as plperlu
> and add language:
> create language plperlu;

It's late and I'm sleepy, but, that looks extremely hazardous to ones
health. Esp if the arrays you speak of have any chance of containing
anything that might look like perl code to begin with. ie think sql
injection, but with perl code rather then sql.

cat

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

Предыдущее
От:
Дата:
Сообщение: Workaround to get arrays for plperl
Следующее
От:
Дата:
Сообщение: Re: Workaround to get arrays for plperl