Explicit LOAD and dynamic library loading

From: Stephen Scheck <singularsyntax(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Explicit LOAD and dynamic library loading
Date: 2013-06-12 17:45:30
Message-ID: CAKjnHz39+0mCnPWgc3_UCs5=S7zeHj39hoHkqMTN3osNXdOwUA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I'm working on two extensions, call them "foo" and "bar". bar depends on
some of the functions defined in foo. They are both built from a single
Makefile, just vanilla PGXS:

MODULES = foo bar
EXTENSION = foo bar
### etc. ###

As bar depends on foo, that's specified in its .control file, and CREATE
EXTENSION works just fine with foo created first, then bar.

However, whenever I run one of the UDTs defined in bar, I get this error
message:

dev=# SELECT * FROM test1 WHERE (info(bar_dat)).some_prop = 10;
ERROR: could not load library
"/vol/data/home/postgres/pg-builds/9.2.4/lib/bar.so":
/vol/data/home/postgres/pg-builds/9.2.4/lib/bar.so: undefined symbol:
foo_func1

I have to explicitly load foo:

dev=# LOAD 'foo.so';

Then everything works. What am I missing?

Thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephen Scheck 2013-06-12 18:48:27 Pass-by-reference UDTs and volatility
Previous Message Merlin Moncure 2013-06-12 15:38:37 Re: Determining the type (array, object, or scalar) of a JSON value