Re: [HACKERS] idea for 'module' support

Поиск
Список
Период
Сортировка
От Todd Graham Lewis
Тема Re: [HACKERS] idea for 'module' support
Дата
Msg-id Pine.LNX.4.04.9906202155060.24228-100000@reflections.eng.mindspring.net
обсуждение исходный текст
Ответ на idea for 'module' support  (Mark Hollomon <mhh@mindspring.com>)
Список 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 по дате отправления:

Предыдущее
От: Mark Hollomon
Дата:
Сообщение: 6.6 changes?
Следующее
От: Clark Evans
Дата:
Сообщение: Re: [HACKERS] BSD vs. GPL