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 445D2030.40301@tada.se
Whole thread Raw
In response to Re: pseudo-type record arguments for PL-functions  (Martijn van Oosterhout <kleptog@svana.org>)
Responses Re: pseudo-type record arguments for PL-functions
List pgsql-hackers
Martijn van Oosterhout wrote:
> Looking at contrib/intarray/_int_op.c might help. It does something
> like this:
>
>         ArrayType  *a = (ArrayType *) DatumGetPointer(PG_DETOAST_DATUM_COPY(PG_GETARG_DATUM(0)));
>
> The file src/include/utils/array.h also seems to have many useful
> functions.
>
> Hope this helps,
>   
Yes, the intarray stuff was very helpful but also somewhat confusing. 
Why are there two ways of representing some of the array types? I mean, 
why is there an _int4 when you could just as well write int4[]? I'm 
probably missing the point altogether.

Regards,
Thomas Hallgren



pgsql-hackers by date:

Previous
From: Thomas Hallgren
Date:
Subject: Re: pseudo-type record arguments for PL-functions
Next
From: Bruce Momjian
Date:
Subject: Re: bug? non working casts for domain