Re: Writing SRF

From: Martin Gainty <mgainty(at)hotmail(dot)com>
To: <jorgearevalo(at)gis4free(dot)org>, Tom State of Pa <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Writing SRF
Date: 2010-04-29 18:08:20
Message-ID: BLU142-W35BF02BD49B00CC9551AD3AE010@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


it has been years since i've mucked in the C++ swamp but
that means your (near) heap is ok but you're stack is hosed..

probably specific to compiler (version) and Operating System(version) and environment settings..ping back if you are still experiencing those problems with those configuration settings

Saludos Cordiales desde EEUU!
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.

> From: jorgearevalo(at)gis4free(dot)org
> Date: Thu, 29 Apr 2010 19:45:41 +0200
> Subject: Re: [GENERAL] Writing SRF
> To: tgl(at)sss(dot)pgh(dot)pa(dot)us
> CC: pgsql-general(at)postgresql(dot)org
>
> On Thu, Apr 29, 2010 at 3:56 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> > Jorge Arevalo <jorgearevalo(at)gis4free(dot)org> writes:
> >> 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?
> >
> > Given only that data point, I would guess that you forgot to mark the
> > function as being called with V1 protocol (PG_FUNCTION_INFO_V1).
> >
> > regards, tom lane
> >
>
> Many thanks! That was one of my errors. Another one was this:
>
> char szDataPointer[10];
> sprintf(szDataPointer, "%p", a_pointer);
>
> These lines caused a memory error. I changed them for:
>
> char * pszDataPointer;
> pszDataPointer = (char *)allocator(10 * sizeof(char));
> sprintf(pszDataPointer, "%p", a_pointer);
>
> Meaning "allocator" a memory allocator in a valid memory context for PostgreSQL.
>
> And seems to work :-). Is the static memory "dangerous" in a
> PostgreSQL memory context?
>
> Thanks again!
> Jorge
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

_________________________________________________________________
The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail.
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andy Colson 2010-04-29 18:16:11 Re: Performance and Clustering
Previous Message Justin Graf 2010-04-29 18:07:31 Re: Storing many big files in database- should I do it?