Re: Optimize PL/Perl function argument passing [PATCH]

From: Alexey Klyukin <alexk(at)commandprompt(dot)com>
To: Tim Bunce <Tim(dot)Bunce(at)pobox(dot)com>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Optimize PL/Perl function argument passing [PATCH]
Date: 2010-12-13 14:42:51
Message-ID: 671BD30F-7F8C-4432-96CD-429DDAEE83DA@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Dec 9, 2010, at 7:32 PM, Tim Bunce wrote:

> On Wed, Dec 08, 2010 at 09:21:05AM -0800, David E. Wheeler wrote:
>> On Dec 8, 2010, at 9:14 AM, Tim Bunce wrote:
>>
>>>> Do you have any more improvements in the pipeline?
>>>
>>> I'd like to add $arrayref = decode_array_literal('{2,3}') and
>>> maybe $hashref = decode_hstore_literal('x=>1, y=>2').
>>> I don't know how much works would be involved in those though.
>>
>> Those would be handy, but for arrays, at least, I'd rather have a GUC
>> to turn on so that arrays are passed to PL/perl functions as array
>> references.
>
> Understood. At this stage I don't know what the issues are so I'm
> nervous of over promising (plus I don't know how much time I'll have).
> It's possible a blessed ref with string overloading would avoid
> backwards compatibility issues.

I used to work on a patch that converts postgres arrays into perl array references:
http://archives.postgresql.org/pgsql-hackers/2009-11/msg01552.php

I have a newer patch, which is, however, limited to one-dimensional resulting
arrays. If there's an interest in that approach I can update it for the
current code base, add support multi-dimensional arrays (I used to implement
that, but lost the changes accidentally) and post it for review.

/A
--
Alexey Klyukin http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2010-12-13 14:51:14 Re: hstores in pl/python
Previous Message Aidan Van Dyk 2010-12-13 14:42:43 Re: ALTER EXTENSION ... UPGRADE;