Re: pseudo-type record arguments for PL-functions - Mailing list pgsql-hackers

From Thomas Hallgren
Subject Re: pseudo-type record arguments for PL-functions
Date
Msg-id 445CC027.7010504@tada.se
Whole thread Raw
In response to Re: pseudo-type record arguments for PL-functions  (David Fetter <david@fetter.org>)
Responses Re: pseudo-type record arguments for PL-functions
Re: pseudo-type record arguments for PL-functions
List 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Remove behaviour of postmaster -o
Next
From: Martijn van Oosterhout
Date:
Subject: Re: pseudo-type record arguments for PL-functions