Re: Writing SRF - Mailing list pgsql-general

From Jorge Arevalo
Subject Re: Writing SRF
Date
Msg-id s2rd321138e1004290621q39468e0bs471867fdd2177336@mail.gmail.com
Whole thread Raw
In response to Re: Writing SRF  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Writing SRF
List pgsql-general
On Wed, Apr 28, 2010 at 10:43 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Jorge Arevalo <jorgearevalo@gis4free.org> writes:
>> My doubt is if I'm doing things right getting all the stuff I need (an
>> array) in the first call, pointing user_fctx to this array and
>> accessing myStructsArray[call_cntr] in each successive call, until
>> myStructsArray + call_cntr == NULL (last array element?).
>
> Sounds reasonable enough.  Is it not working for you?  Maybe you need
> to be careful about which memory context the array is created in.
>
>                        regards, tom lane
>

Yes. For example, the function expects 2 arguments, and it's called
with 2 arguments: 1 composite type (following this format
https://svn.osgeo.org/postgis/spike/wktraster/doc/RFC1-SerializedFormat)
and one integer. But PG_NARGS() returns a really big value (16297)
when I first check the number of arguments at the beginning of the
function. Has sense?

The array, if I'm doing things right, is created in the context
pointed by fcinfo->flinfo->fn_mcxt. But I'd like to solve "silly"
things like the previous before, and to be sure I'm doing things
right, in general. Now, I know at least sounds reasonable :-)

Many thanks!

pgsql-general by date:

Previous
From: Alban Hertroys
Date:
Subject: Re: Performance and Clustering
Next
From: "sandeep prakash dhumale"
Date:
Subject: Tsearch not searching 'Y'