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

Re: 9.2 won't load C-language function

From: Craig James <cjames(at)emolecules(dot)com>
To: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: 9.2 won't load C-language function
Date: 2012-10-11 17:35:51
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
On Wed, Oct 10, 2012 at 10:08 PM, Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>wrote:

> On 10/11/2012 02:22 AM, Craig James wrote:
>> I have a C-language function I've been using on 8.4 for a long time.  On
>> 9.2 it won't load:
>> test=# set search_path = public;
>> SET
>> test=# CREATE OR REPLACE FUNCTION chmoogle_session_id() RETURNS integer
>> AS '/usr/local/pgsql/lib/**', 'chmoogle_session_id'
>> ERROR:  could not load library "/usr/local/pgsql/lib/**":
>> cannot open shared object file: No such file or
>> directory
> What does `ldd /usr/local/pgsql/lib/**` say? What about
> when run under the PostgreSQL user account?

Too late ... after reading up on LD_LIBRARY_PATH and why ldconfig is
better, I just ran ldconfig on the /usr/local/pgsql/lib and
/usr/local/openbabel/lib directories.  Problem fixed.

> You may need to set LD_LIBRARY_PATH in the Pg startup script, or modify
>, or re-build your extension with rpath linking enabled.
> As for why it worked with 8.4 - I expect you either altered
> LD_LIBRARY_PATH in the 8.4 startup scripts, or maybe the 8.4 version of the
> extension was built with -Wl,-rpath so the paths to required libraries were
> embedded into the extension library.

It is a bit odd ... 8.4 was working, and I just compiled and installed 9.2
on top of it (and created a fresh database).  Oh well, I guess it will
remain a mystery.

Craig James

> --
> Craig Ringer

In response to

pgsql-admin by date

Next:From: Arun PaduleDate: 2012-10-12 07:47:27
Subject: How to find dependent procdures on a table in postgresql
Previous:From: Bruce MomjianDate: 2012-10-11 14:11:36
Subject: Re: Pg 8.3.x on RHEL 6.3?

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