Dynamic loading of C functions: Badly stuck

From: "Jasbinder Bali" <jsbali(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Dynamic loading of C functions: Badly stuck
Date: 2006-06-21 16:42:23
Message-ID: a47902760606210942t4b970c38kbb1342d0845898c6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,
I raised this problem yesterday aswell. I'm badly stuck at this point.
The problem is as follows:

I have a C function that i want to use in my postgres function.
I adopt the following steps to do that.

--- compile the C file as follows
gcc -shared -o test_func.so test_func.c
test_func.c is the name of the C file

--- the name of the function that i want to use from this c file is called
'command'

--- Postgres function is written as follows:

CREATE FUNCTION command(integer) RETURNS integer
AS 'usr/include/pgsql/server/test_func', 'command'
LANGUAGE C STRICT;

when i try to run this function, always gives me the follwoing error:

ERROR: could not access file "usr/include/pgsql/server/test_func": No such
file or directory

I tried changin the permission of the file to 666 and even tried it with 755
but in vein.

I checked the log file but it just prints the above error and doesn't give
me any more information.

I have no clue why is postgres not reading test_func object file.

Any kind of help would be appreciated

Thanks,
~Jas

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2006-06-21 16:46:44 Re: Dynamic loading of C functions: Badly stuck
Previous Message Jasbinder Bali 2006-06-21 16:03:26 Re: Dynamic loading of C functions