Problem creating a C function

From: "Mark R(dot) Will" <digico(at)shaw(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Problem creating a C function
Date: 2002-06-07 01:03:28
Message-ID: 002d01c20dbf$2228d090$84b54118@digico1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
winmail.dat application/ms-tnef 2.1 KB

Browse pgsql-general by date

  From Date Subject
Next Message Steven Vajdic 2002-06-07 02:26:39 Re: [HACKERS] PostgreSQL and Windows2000 and defunct processes
Previous Message Bill Moran 2002-06-07 00:44:12 Re: Demo versions