Dynamic loading of C functions: Badly stuck

Поиск
Список
Период
Сортировка
От Jasbinder Bali
Тема Dynamic loading of C functions: Badly stuck
Дата
Msg-id a47902760606210942t4b970c38kbb1342d0845898c6@mail.gmail.com
обсуждение исходный текст
Ответы Re: Dynamic loading of C functions: Badly stuck
Re: Dynamic loading of C functions: Badly stuck
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: "Jasbinder Bali"
Дата:
Сообщение: Re: Dynamic loading of C functions
Следующее
От: Joe Conway
Дата:
Сообщение: Re: Dynamic loading of C functions: Badly stuck