Re: Writing SRF

From: Jorge Arevalo <jorgearevalo(at)gis4free(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL - General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Writing SRF
Date: 2010-04-29 13:21:58
Message-ID: s2rd321138e1004290621q39468e0bs471867fdd2177336@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Apr 28, 2010 at 10:43 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Jorge Arevalo <jorgearevalo(at)gis4free(dot)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!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ashish.Arya 2010-04-29 13:23:45 Re: FW: Java Memory Issue while Loading Postgres library
Previous Message sandeep prakash dhumale 2010-04-29 13:13:40 Tsearch not searching 'Y'