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

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

From: Alexey Klyukin <alexk(at)commandprompt(dot)com>
To: Alex Hunsaker <badalex(at)gmail(dot)com>
Cc: "David E(dot) Wheeler" <david(at)kineticode(dot)com>, pgsql-hackers(at)postgresql(dot)org, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: Re: arrays as pl/perl input arguments [PATCH]
Date: 2011-02-10 13:15:59
Message-ID: 2B74E731-6086-4027-8864-0B37BB081B23@commandprompt.com (view raw or flat)
Thread:
Lists: pgsql-hackers
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.

/A

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





In response to

Responses

pgsql-hackers by date

Next:From: Robert HaasDate: 2011-02-10 13:22:47
Subject: Re: Re: [COMMITTERS] pgsql: Update docs on building for Windows to accomodate current realit
Previous:From: Itagaki TakahiroDate: 2011-02-10 13:13:01
Subject: Re: psql patch: tab-complete :variables also at buffer start

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