Re: plperl & sort

Поиск
Список
Период
Сортировка
От Alex Hunsaker
Тема Re: plperl & sort
Дата
Msg-id 34d269d40811041127k45d05346jfcdd5228d964be34@mail.gmail.com
обсуждение исходный текст
Ответ на plperl & sort  (Jeff <threshar@torgo.978.org>)
Ответы Re: plperl & sort  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: plperl & sort  (Jeff <threshar@torgo.978.org>)
Список pgsql-bugs
On Tue, Nov 4, 2008 at 09:02, Jeff <threshar@torgo.978.org> wrote:
> I've ran into this interesting problem.
> It seems that while you can call sort() in a trusted plperl func you cannot
> access $a & $b which effectively makes it useless.

Hrm works for me if I take out the elog from sort()

create or replace function trustedsort()
returns int
as $$

my @arr = qw(5 4 3 2 1);

my @sorted = sort { $a <=> $b } @arr;

elog(NOTICE, join(' ', @sorted));

return 1;

$$
language 'plperl';

SELECT trustedsort();
NOTICE:  1 2 3 4 5
 trustedsort
-------------
           1
(1 row)

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: plperl & sort
Следующее
От: Tom Lane
Дата:
Сообщение: Re: plperl & sort