Skip site navigation (1) Skip section navigation (2)

Re: plperl & sort

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Alex Hunsaker" <badalex(at)gmail(dot)com>
Cc: Jeff <threshar(at)threshar(dot)is-a-geek(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: plperl & sort
Date: 2008-11-04 19:39:06
Message-ID: 26675.1225827546@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Alex Hunsaker" <badalex(at)gmail(dot)com> writes:
> Hrm works for me if I take out the elog from sort()

Even more interesting, this variant *doesn't* work:

regression=# 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';
CREATE FUNCTION
regression=# select trustedsort();
NOTICE:  5 4 3 2 1
 trustedsort 
-------------
           1
(1 row)

Seems like it's the interpolation into a string that is failing.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Alex HunsakerDate: 2008-11-04 19:43:52
Subject: Re: plperl & sort
Previous:From: Alex HunsakerDate: 2008-11-04 19:27:01
Subject: Re: plperl & sort

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group