Of course, here is the solution I used (to create a C
function to link to with PG):
'$' means done at command prompt
'=>' means done at psql prompt
this was done in Linux (RedHat 6.1) with PG 6.5 and
1) I made the C source file, file.c, which included
2) compiled as object:
$ gcc -fpic -c -o file.o file.c
$ ld -Bshareable -o file.so file.o
3) added function with SQL:
=> create function function_name(int4,float) returns
float AS '/path/to/file.so' language 'c';
4) test function with SQL:
=> select function_name(7,8.3) as number;
Hope this helps someone,
PS: If I get a good array function written (which I am
working on now) I will contribute that as well.
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
pgsql-general by date
|Next:||From: Lamar Owen||Date: 2000-01-24 03:20:03|
|Subject: Re: [GENERAL] RE: Where is the Database log file ?|
|Previous:||From: Marcin Mazurek - Multinet SA - Poznan||Date: 2000-01-24 02:37:39|
|Subject: Re: [GENERAL] It works now :)|