Re: [HACKERS] idea for 'module' support - Mailing list pgsql-hackers

From Todd Graham Lewis
Subject Re: [HACKERS] idea for 'module' support
Date
Msg-id Pine.LNX.4.04.9906202155060.24228-100000@reflections.eng.mindspring.net
Whole thread Raw
In response to idea for 'module' support  (Mark Hollomon <mhh@mindspring.com>)
List pgsql-hackers
On Sun, 20 Jun 1999, Mark Hollomon wrote:

> For instance, a user may type:
> 
> LOAD PACKAGE 'plperl';
> 
> This would not only load the shared library "plperl.so", but call
> the function "package_init" which could the use the SPI facilities
> to properly setup the system tables for the new language.
> 
> New types could be packaged the same way.
> 
> This would give a very modular way to add 'packages' of functionality.
> 
> What do you think?

Lots of people do this, but you might want to take a look at how we do
this in Dents, just because it's moderately well documented.  I did the
initial version inspired by how GTK+ loads new themes, but the basic
idea is the same everywhere: dlopen() an object, resolve symbols in it,
use those symbols to populate a struct filled with function pointers
and whatnot.

You can find docs on how to write Dents modules at:
http://www.dents.org/modules/modules.html

For how we actually do it, look in the source code under "src/*module*".

I personally think that this is a neat idea in general and might be very
nifty for Postgres.

--
Todd Graham Lewis                        Postmaster, MindSpring Enterprises
tlewis@mindspring.net                                (800) 719-4664, x22804
                         "There is no spoon."



pgsql-hackers by date:

Previous
From: Mark Hollomon
Date:
Subject: 6.6 changes?
Next
From: Clark Evans
Date:
Subject: Re: [HACKERS] BSD vs. GPL