Re: [HACKERS] plperl returning setof foo[]

2009-09-28 Thread Andrew Dunstan
Abhijit Menon-Sen wrote: The fix is fairly small (see attached) although I need to check with some perlguts guru to see if I need to decrement a refcounter here or there. Slightly simpler patch attached (and tested). Thanks. Committed. cheers andrew -- Sent via pgsql-hackers ma

Re: [HACKERS] plperl returning setof foo[]

2009-09-28 Thread Abhijit Menon-Sen
At 2009-09-12 13:17:50 -0400, and...@dunslane.net wrote: > > I have just noticed, somewhat to my chagrin, that while in a plperl > function that returns an array type you can return a perl arrayref, > like this: > >return [qw(a b c)]; > > if the function returns a setof an array type you cannot

Re: [HACKERS] plperl returning setof foo[]

2009-09-12 Thread Andrew Dunstan
Tom Lane wrote: Nobody has complained about it over the years, so I wonder if it should be backpatched. It wouldn't change any working behaviour, just remove the non-working property of some documented behaviour. AFAICT it just fails, so backpatching seems like a bug fix not a behaviora

Re: [HACKERS] plperl returning setof foo[]

2009-09-12 Thread Tom Lane
Andrew Dunstan writes: > The fix is fairly small (see attached) although I need to check with > some perlguts guru to see if I need to decrement a refcounter here or there. The array_ret variable seems a bit unnecessary, and declared well outside the appropriate scope if it is necessary. > Nobo

[HACKERS] plperl returning setof foo[]

2009-09-12 Thread Andrew Dunstan
I have just noticed, somewhat to my chagrin, that while in a plperl function that returns an array type you can return a perl arrayref, like this: return [qw(a b c)]; if the function returns a setof an array type you cannot do this: return_next [qw(a b c)]; Now the plperl docs say: