Trying to make functions in 'C'

From: "fabian baena" <fabbaena(at)hotmail(dot)com>
To: pgsql-general(at)postgreSQL(dot)org
Subject: Trying to make functions in 'C'
Date: 1999-05-16 11:23:25
Message-ID: 19990516162326.84206.qmail@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message selkovjr 1999-05-16 19:24:24 Re: [GENERAL] Trying to make functions in 'C'
Previous Message Chris Bitmead 1999-05-16 09:59:11 Re: [GENERAL] RH 6.0 and PostgreSQL