Re: pseudo-type record arguments for PL-functions

From: Thomas Hallgren <thomas(at)tada(dot)se>
To: David Fetter <david(at)fetter(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pseudo-type record arguments for PL-functions
Date: 2006-05-06 15:26:31
Message-ID: 445CC027.7010504@tada.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

David Fetter wrote:
> On Thu, May 04, 2006 at 09:02:02PM +0200, Thomas Hallgren wrote:
>
>> Tom Lane wrote:
>>
>>>> Why can PLs not handle pseudo-types?
>>>>
>>> No one's done the work to figure out which ones are sensible to
>>> support and then add the logic needed to support them.
>>>
>>>
>> PL/Java will handle the RECORD type correctly. I'm just finalizing a
>> new, more flexible, type mapping implementation for PL/Java and it
>> would be easy to add support for more pseudo types too. But what
>> others would make sense?
>>
>
> Ideally, some way to get all kinds of user-defined types. DOMAINs,
> too. :)
>
>
OK, got them covered as well. Only thing that remain now is arrays. I
have a hard time figuring out how to manage them. I'm looking at the
arrayutils.c. The thing that makes me a bit confused is the
ArrayMetaState. The functions obtain it using:

my_extra = (ArrayMetaState *) fcinfo->flinfo->fn_extra;

which is fine if there's only one array parameter. What happens if I
have two? And how do I declare a function that takes, say, an array of
int's as a parameter (in SQL that is)?

I find very little information about how to write functions that deals
with arrays. My only source of information right now is the
arrayutils.c. Other pointers to docs and code are greatly appreciated.

Kind Regards,
Thomas Hallgren

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-05-06 15:52:08 Re: pseudo-type record arguments for PL-functions
Previous Message Tom Lane 2006-05-06 15:16:13 Re: Remove behaviour of postmaster -o