[postgis-devel] Debugging my rounding function

David Blasby dblasby at refractions.net
Wed Jun 30 09:10:55 PDT 2004


Gino Lucrezi wrote:
> Unfortunately, PostgreSQL crashes as soon as I call my function, before even
> entering it.

> < PG_FUNCTION_INFO_V1(GeomRound);
> < Datum geom_round(PG_FUNCTION_ARGS)


You have "GeomRound" in the top line, but "geom_round" in the 2nd line; 
they need to be the same.

You're getting a crash because the "PG_FUNCTION_INFO_V1" macro isnt 
properly setting up the function so Postgresql can call it (and give it 
arguments).
When you get to the line:

"GEOMETRY *geom = (GEOMETRY *)  PG_DETOAST_DATUM(PG_GETARG_DATUM(0));"

it crashes because its trying to access arguments that havent actually 
been sent to the function.

dave



More information about the postgis-devel mailing list