Re: arrays as pl/perl input arguments [PATCH]

From: Alexey Klyukin <alexk(at)commandprompt(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Alex Hunsaker <badalex(at)gmail(dot)com>, "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: arrays as pl/perl input arguments [PATCH]
Date: 2011-02-10 21:26:58
Message-ID: 353B1A8D-2AB5-460F-8DF7-E51632FA8A0B@commandprompt.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Feb 10, 2011, at 9:44 PM, Andrew Dunstan wrote:

>
>
> On 02/10/2011 08:15 AM, Alexey Klyukin wrote:
>> On Feb 9, 2011, at 9:28 PM, Alex Hunsaker wrote:
>>
>>> On Wed, Feb 9, 2011 at 08:24, Alexey Klyukin<alexk(at)commandprompt(dot)com> wrote:
>>>> What was actually broken in encode_array_literal support of composite types
>>>> (it converted perl hashes to the literal composite-type constants, expanding
>>>> nested arrays along the way) ? I think it would be a useful extension of the
>>>> existing encode_array_literal.
>>> Yeah, It does not work because it did not take into account the order
>>> of composite columns. It always put them alphabetically by column
>>> name. To do it properly we would need to pass in a typid or a column
>>> order or something. Ideally we could expose the new
>>> plperl_array_to_datum() to plperl functions in some manner.
>> Damn, right. Each perl hash corresponds to multiple composite types, different
>> by the order of the type elements. Passing the typid sounds like a fair
>> requirement (and if it's missing we could assume that the order of columns in
>> composites doesn't matter to the caller).
>>
>> Let me try implementing that as an XS interface to plperl_array_to_datum.
>
>
> Are you intending this as a completion of the current patch or as 9.2 work? If the former you need to send it in real fast.

I'd like to extend the current patch, going to post the update by tomorrow.

/A

--
Alexey Klyukin
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2011-02-10 21:32:07 Re: ALTER EXTENSION UPGRADE, v3
Previous Message Steve Singer 2011-02-10 21:26:13 Re: pl/python custom exceptions for SPI