Tiberiu Stef <tstef@cs.purdue.edu> writes:
> I created a C function:
> CREATE OR REPLACE FUNCTION fintransfunc(double precision,double precision)
> RETURNS double precision AS '$libdir/finops.so' LANGUAGE C;
You probably want to mark it strict (WITH (isStrict)), unless it's
prepared to deal with NULL inputs. I'm betting your table contains
some NULLs.
> However, if I replace in the aggregate creation the fintransfunc with
> float8smaller, and then test again, the query goes through and produces
> the desired result.
float8smaller is marked isStrict ...
> From my tests, I guess the aggregate interpreter fails to find a function
> that is not in the default postgres server library.
No, your routine is dumping core on a null pointer dereference, as you
should have been able to find out for yourself with a debugger. If you
don't know how to use gdb or some other debugger, writing C functions is
not going to be much fun for you.
regards, tom lane