Problem creating a C function - Mailing list pgsql-general

From Mark R. Will
Subject Problem creating a C function
Date
Msg-id 002d01c20dbf$2228d090$84b54118@digico1
Whole thread Raw
List pgsql-general
I've compiled a C routine to be used as a database function on Postgres
7.1.3 installed on RedHat 7.1.  No errors or warnings except when I try to
add it.  I'm using the command:

CREATE OR REPLACE FUNCTION myfunc(text,int,int,int) RETURNS text AS
'$libdir/libmyfunc.so', 'myfunc' LANGUAGE C;

I'm getting the following message:

ERROR:  Load of file /usr/lib/pgsql/libmyfunc.so failed:
/usr/lib/pgsql/libmyfunc.so: undefined symbol: MemoryContextFree

I know that MemoryContextFree is called by the pfree() macro, which I call a
number of times in the routine.  The library libmyfunc.so is definitely in
/usr/lib/pgsql and if I specify the absolute path to it in the CREATE
command or drop the 'myfunc' bit just before LANGUAGE I still get the exact
same message.  If it helps any, the source code uses this sequence of
includes:

#include "postgres.h"
#include "executor/executor.h"
#include "executor/spi.h"
#include <string.h>
#include "fmgr.h"

Any ideas on what might be happening?  Thx.

- Mark.

Attachment

pgsql-general by date:

Previous
From: Bill Moran
Date:
Subject: Re: Demo versions
Next
From: Steven Vajdic
Date:
Subject: Re: [HACKERS] PostgreSQL and Windows2000 and defunct processes