Re: Writing SRF
От | Jorge Arevalo |
---|---|
Тема | Re: Writing SRF |
Дата | |
Msg-id | s2rd321138e1004290621q39468e0bs471867fdd2177336@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Writing SRF (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Writing SRF
|
Список | 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 по дате отправления: