pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Craig James <cjames@emolecules.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: 9.2 won't load C-language function
Date: Thu, 11 Oct 2012 13:08:30 +0800
Message-ID: <5076544E.60307@ringerc.id.au> (raw)
In-Reply-To: <CAFwQ8reTRHRgfhwQ-yQ+121JBwg67fEwQb677A_-j1CJQCztoA@mail.gmail.com>
References: <CAFwQ8reTRHRgfhwQ-yQ+121JBwg67fEwQb677A_-j1CJQCztoA@mail.gmail.com>

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/libchmoogle.so', 'chmoogle_session_id'
> LANGUAGE c VOLATILE;
> ERROR:  could not load library "/usr/local/pgsql/lib/libchmoogle.so":
> libopenbabel.so.4: cannot open shared object file: No such file or directory

What does `ldd /usr/local/pgsql/lib/libchmoogle.so` say? What about when 
run under the PostgreSQL user account?

You may need to set LD_LIBRARY_PATH in the Pg startup script, or modify 
ld.so.conf, 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.

--
Craig Ringer




view thread (4+ messages)  latest in thread

Message-ID: <5076544E.60307@ringerc.id.au>
Permalink:  ../5076544E.60307@ringerc.id.au/
Also on:    postgresql.org/message-id/5076544E.60307@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: ringerc@ringerc.id.au, cjames@emolecules.com
  Subject: Re: 9.2 won't load C-language function
  In-Reply-To: <5076544E.60307@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox