Search Postgresql Archives

Dynamic loading of C functions: Badly stuck

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux