Re: arrays as input parameter for c functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alexaki Sofia <alexaki(at)ics(dot)forth(dot)gr>
Cc: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: arrays as input parameter for c functions
Date: 2002-07-12 13:43:40
Message-ID: 9256.1026481420@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces

Alexaki Sofia <alexaki(at)ics(dot)forth(dot)gr> writes:
> I want to add a c function in PostgreSQL (7.2.1)
> Is it possible the input parametrs othe function to be
> arrays of text (i.e., text *temp[10])?

You can certainly make the function take a "text[]", but it's not
going to be spoon-fed to you as a C array; you'll need to break down
the array value yourself. See deconstruct_array. (The aggregate
support functions for numeric avg/stddev/etc might be useful examples
of interpreting and constructing arrays of varlena datums.)

regards, tom lane

In response to

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Warren W. Gay VE3WWG 2002-07-12 13:55:06 Re: Wish List: Client access to NUMERIC/DECIMAL type functions
Previous Message Jan Wieck 2002-07-12 13:38:49 Re: Wish List: Client access to NUMERIC/DECIMAL type functions