Re: Dynamic loading of C functions

From: elein <elein(at)varlena(dot)com>
To: Jasbinder Bali <jsbali(at)gmail(dot)com>
Cc: Bill Moran <wmoran(at)collaborativefusion(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Dynamic loading of C functions
Date: 2006-06-20 21:21:02
Message-ID: 20060620212102.GS18464@varlena.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Do you need to specify ....test_func.so not ...test_func
or has that changed?

--elein

On Tue, Jun 20, 2006 at 05:13:32PM -0400, Jasbinder Bali wrote:
> chmod 666 filename is something i've done to give permissions to all..
> still doesn't work.
>
>
> On 6/20/06, Bill Moran <wmoran(at)collaborativefusion(dot)com> wrote:
>
> In response to "Jasbinder Bali" <jsbali(at)gmail(dot)com>:
>
> > I've written a function in C, compiled it and trying to use the same
> > function in one of my postgres functions like this:
> >
> > CREATE FUNCTION add_one(integer) RETURNS integer
> > AS '/usr/include/pgsql/server/test_func, 'add_one'
> > LANGUAGE C STRICT
> >
> > test_func is the name of my object file and add_one is the name of
> > the function i want to call from test_func.c C file.
> >
> > I get the follwing error
> > ERROR: could not access file "/usr/include/pgsql/server/test_func": No
> such
> > file or directory
> >
> > /usr/include/pgsql/server/ is exactly the path where test_func object
> file
> > resides.
> > Don't know why isn't postgres able to find it there.
> >
> > Any kind of help would be appreciated.
>
> Check the permissions. Can the Postgres user read the file?
>
> I don't remember if it has to be marked executable or not, but that's
> something to check.
>
> --
> Bill Moran
> Collaborative Fusion Inc.
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-06-20 21:24:15 Re: Dynamic loading of C functions
Previous Message Jasbinder Bali 2006-06-20 21:13:32 Re: Dynamic loading of C functions