Problem creating a C function

Поиск
Список
Период
Сортировка
От Mark R. Will
Тема Problem creating a C function
Дата
Msg-id 002d01c20dbf$2228d090$84b54118@digico1
обсуждение исходный текст
Список 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.

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Bill Moran
Дата:
Сообщение: Re: Demo versions
Следующее
От: Steven Vajdic
Дата:
Сообщение: Re: [HACKERS] PostgreSQL and Windows2000 and defunct processes