Arrays in V1 calls - Mailing list pgsql-novice

From mila boldareva
Subject Arrays in V1 calls
Date
Msg-id 15208214736.20020227203628@dds.nl
Whole thread Raw
Responses Re: Arrays in V1 calls  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Hello
I try to pass a column from a table as a parameter to a C function.

The column is an array of float8 with V1 method.
I can't find the method to pick up the arguments-arrays,

the whole thing looks like this:

PG_FUNCTION_INFO_V1(my_func);
Datum
my_func(PG_FUNCTION_ARGS) {
     ????? how to get  the parameter as a pointer
     and reach 1st, second, etc. element of array?

     float8 *a = PG_GETARG_POINTER(0) ;
     float8 c = *(a+1) ;
     ^^^^^^^^^^^^^^^^^ doesn't give the value of a[2],
                       but an incredible number
PG_RETURN_FLOAT8(c);
}

Please help me out, or recommend where to find the info (at developers
guide I found nothing like that)


thanks,
 mila                          mailto:pierro@dds.nl


pgsql-novice by date:

Previous
From: "Josh Berkus"
Date:
Subject: Re: Unicode and PGAccess
Next
From: Tom Lane
Date:
Subject: Re: Arrays in V1 calls