I'm tying to learn how to make function in 'C'.
I'm trying to compile a program I made in 'C'.
The command I gave were:
% gcc -fPIC -c addone.c -I/usr/local/pgsql/include
% ld -G -Bdynamic -o addone.so addone.o
and created the function in postgres like this:
CREATE FUNCTION add_one(int4) RETURNS int4
AS './addone.so' LANGUAGE 'c';
The function I made looks like this:
#include "postgres.h"
int
add_one(int arg)
{
return arg + 1;
}
But when I try to test the function in postgres I recieve this error:
ERROR: stat failed on file ./addone.so
ERROR: stat failed on file ./addone.so
Can anyone tell where did I make a mistake?
I have a linux on a PC.
Thank you.
Fabian.
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com