Re: expert : SRF returning double[] - Mailing list pgsql-general

From Rémi Cura
Subject Re: expert : SRF returning double[]
Date
Msg-id CAJvUf_t5C-y4pVJUw+Zz7xZ-5y2eK5=ZajEozZYMPNkpZ6-_Mg@mail.gmail.com
Whole thread Raw
In response to expert : SRF returning double[]  (Rémi Cura <remi.cura@gmail.com>)
List pgsql-general
another auto-answer :

Suprisingly ,

result = construct_array(...)
SRF_RETURN_NEXT(funcctx, PointerGetDatum(result));

But Datum memory must be allocated

Cheers,

Rémi-C


2014/1/16 Rémi Cura <remi.cura@gmail.com>
Hey list,

another tricky C function interface problem :

How to write a set returning function, that returns for each row an array?

it seems like the main function SRF_RETURN_NEXT takes Datum and so I can't use PG_RETURN_ARRAYTYPE_P().

Shall I encapsulate the array into a composite field (only 1 field : the double array)

I looked a lot for an example wihtout success.

Help greatly appreciated,

thanks,

Cheers,
Rémi-C

pgsql-general by date:

Previous
From: Rémi Cura
Date:
Subject: expert : SRF returning double[]
Next
From: John R Pierce
Date:
Subject: Re: Need Help to implement Proximity search feature