Re: PG Extensions: Must be statically linked? - Mailing list pgsql-hackers

From John Gray
Subject Re: PG Extensions: Must be statically linked?
Date
Msg-id pan.2006.03.03.00.27.18.814931@azuli.co.uk
Whole thread Raw
In response to PG Extensions: Must be statically linked?  ("Craig A. James" <cjames@modgraph-usa.com>)
List pgsql-hackers
On Thu, 02 Mar 2006 13:43:35 -0800, Craig A. James wrote:

> I'm creating user-defined server extensions, written in C per the manual

[snip]
> Is this correct?  Do Postgres extension need to be fully statically
> linked?  Or is there some configuration that will specify LD_LIBRARY_PATH
> (or perhaps a Postgres-specific equivalent).
> 

Not generally, unless your platform requires it because of restrictive
dynamic loader behaviour. contrib/xml2 uses two external libraries
(libxml and libxslt) - they are dynamically referenced by the resulting
pgxml.so. Have a look at the Makefile for contrib/xml2 for hints on
options?


> The manual's instructions are good regarding writing code, but don't say
> much about linking.
> 

True - but I think the assumption has been that most
people wouldn't have any involved linking requirements. Your case doesn't
come into this category, but there are useful cases for linking to
external function libraries and exposing them to PG. 

Regards

John



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [NOVICE] pg_config --pgxs
Next
From: "Matthew T. O'Connor"
Date:
Subject: Re: Automatic free space map filling