dynamically loaded functions

From: TJ O'Donnell <tjo(at)acm(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: dynamically loaded functions
Date: 2005-07-12 03:16:17
Message-ID: 42D33601.5080605@acm.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

I've written some c-functions which depend on my code (gnova.so)
as well as a third-party library of functions (oe_chem.so).
Up until now, I've been preloading (in postgresql.conf) both .so's
and it all works fine. To make it easier for my users to install my stuff,
I'd like to avoid the preloading, but this would
require giving 2 .so names in the CREATE FUNCTION statement (I imagine).
So, what I would like to do is something like this:

CREATE or REPLACE FUNCTION cansmiles(varchar) RETURNS varchar
AS 'gnova,oe_chem', 'oe_cansmiles' LANGUAGE 'c' IMMUTABLE STRICT;

but I get this:
ERROR: could not access file "gnova,oe_chem": No such file or directory

What I'm doing now:
CREATE or REPLACE FUNCTION cansmiles(varchar) RETURNS varchar
AS 'gnova', 'oe_cansmiles' LANGUAGE 'c' IMMUTABLE STRICT;
requires preloading of oe_chem.so to work.

Is there any way I can associate oe_cansmiles with 2 .so's without
preloading?

More info:
oe_cansmiles is in gnova.so, but there are functions
in gnova.so that are in oe_chem.so.

TJ

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe 2005-07-12 05:16:07 Converting MySQL tinyint to PostgreSQL
Previous Message Thomas F. O'Connell 2005-07-12 01:12:19 Re: Quoting $user as Parameter to SET

Browse pgsql-sql by date

  From Date Subject
Next Message Dinesh Pandey 2005-07-12 03:39:44 How to store and retrieve data with special characters (\n, \r, \f, \t) in the same format
Previous Message CG 2005-07-11 18:02:42 Re: Clustering problem