From: fabian baena <fabbaena@hotmail.com>
To: pgsql-general@postgreSQL.org
Subject: Trying to make functions in 'C'
Date: Sun, 16 May 1999 11:23:25 COT
Message-ID: <19990516162326.84206.qmail@hotmail.com> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: fabbaena@hotmail.com
Subject: Re: Trying to make functions in 'C'
In-Reply-To: <19990516162326.84206.qmail@hotmail.com>
References: <19990516162326.84206.qmail@hotmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox