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

From Martijn van Oosterhout
Subject Re: pseudo-type record arguments for PL-functions
Date
Msg-id 20060506155208.GC4413@svana.org
Whole thread Raw
In response to Re: pseudo-type record arguments for PL-functions  (Thomas Hallgren <thomas@tada.se>)
Responses Re: pseudo-type record arguments for PL-functions
List pgsql-hackers
On Sat, May 06, 2006 at 05:26:31PM +0200, Thomas Hallgren wrote:
> 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.

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,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

pgsql-hackers by date:

Previous
From: Thomas Hallgren
Date:
Subject: Re: pseudo-type record arguments for PL-functions
Next
From: Tom Lane
Date:
Subject: Re: pseudo-type record arguments for PL-functions