Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TMB0f-0000Xx-EN for pgsql-admin@postgresql.org; Thu, 11 Oct 2012 05:08:37 +0000 Received: from mail-pb0-f46.google.com ([209.85.160.46]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TMB0e-0000jN-GU for pgsql-admin@postgresql.org; Thu, 11 Oct 2012 05:08:37 +0000 Received: by mail-pb0-f46.google.com with SMTP id rr4so1461623pbb.19 for ; Wed, 10 Oct 2012 22:08:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=ipsXT2qDWkkxVvnG7Izyp7sLCcRnxvGVQ8Qgh7+Tqfc=; b=VEzPfxGTqlsvA2JhvtsWAhGucfRt702UkSXk6ElyFSyNSFUCAPfxR7DpVxJ088S4DI 4Yf9SXPpO135fX+GKzSPKZxiEtc6I9BtQnchUyYI6uiPrt0rVURzKf9dgfBleGB5o2cM WgOTJ1Syi3YGcHXkLJGEdjmEK46/CZZdUgi0UGz4RfEAxzXuN4RSoWlCkUj8M6UpAnmg U3tSjCMpzp5ETRRFCXwdaZQaaeIVdJHWNrht2/iu1y+Nvt9003BeX2cVOkCnIKogsUK8 dbohFc+XALXyVb4s46844/rNG7PkdTDZ5tYJn1H/SWT8MMdh4UZk4D7ASFktDAYpCI6v qjwA== Received: by 10.66.75.132 with SMTP id c4mr69024382paw.2.1349932115115; Wed, 10 Oct 2012 22:08:35 -0700 (PDT) Received: from ayaki.localdomain (office1.postnewspapers.com.au. [150.101.171.128]) by mx.google.com with ESMTPS id j9sm1995080paw.2.2012.10.10.22.08.32 (version=SSLv3 cipher=OTHER); Wed, 10 Oct 2012 22:08:34 -0700 (PDT) Message-ID: <5076544E.60307@ringerc.id.au> Date: Thu, 11 Oct 2012 13:08:30 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Craig James CC: pgsql-admin@postgresql.org Subject: Re: 9.2 won't load C-language function References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQki3aMs+9n0jCw0ahS8KgEMZvdftJL8SsSI1Pe+OcmtCLPmqzqL40PiKJWDQYbNEYLwxNT0 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201210/34 X-Sequence-Number: 40150 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