Skip site navigation (1) Skip section navigation (2)


From: Jeff Davis <jeff95350(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Solution
Date: 2000-01-24 02:59:46
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
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.o

3) added function with SQL:
=> create function function_name(int4,float) returns
float AS '/path/to/' language 'c';

4) test function with SQL:
=> select function_name(7,8.3) as number;

Hope this helps someone,
Jeff Davis

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 OwenDate: 2000-01-24 03:20:03
Subject: Re: [GENERAL] RE: Where is the Database log file ?
Previous:From: Marcin Mazurek - Multinet SA - PoznanDate: 2000-01-24 02:37:39
Subject: Re: [GENERAL] It works now :)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group