Thread: postgresql extension API proof of concept

postgresql extension API proof of concept

From
Fabien COELHO
Date:
Dear hackers,

after some comments and discussions, here is a proof-of-concept
demonstration of a postgresql extension infrastructure.

(1) apply the patch...

(2) ********** REGENERATE CONFIGURE ************
 sh> autoconf configure.in > configure sh> chmod +x configure

(3) configure, compile, install and use postgresql:
 sh> configure --prefix=/tmp/pg sh> make sh> make install
  where is our postgresql installation... sh> PATH=/tmp/pg/bin:$PATH


(5) build an extension with the new infrastructure, for instance   with some contrib that define a new type.
 sh> cd contrib/isbn_issn sh> mv Makefile Makefile.old
   now create an appropriate extension Makefile (well, this should   have been done by the person who provides the
extension)
 sh> cat > Makefile
PGXSDIR := $(shell pg_config --pgxsdir)
include $(PGXSDIR)/pgxs_begin.mk
MODULES = isbn_issn
DATA_built = isbn_issn.sql
DOCS = README.isbn_issn
include $(PGXSDIR)/pgxs_end.mk

(6) now enjoy:  sh> make  sh> make install  sh> make clean  sh> make uninstall


There is a sample extension makefile in $(pg_config --pgxsdir)/Makefile.pgxs
No real documentation yet, maybe hidden bugs...

Thanks in advance for your comments.

-- 
Fabien Coelho - coelho@cri.ensmp.fr

Re: postgresql extension API proof of concept

From
Fabien COELHO
Date:
Dear Carl,

> What is the purpose of the extension api in simple terms; what is it FOR?
> What does it DO?

Thanks for this perfectly legitimate question, as my mail was not very
easy to understand without the context.

The aim is to provide a compilation infrastructure to external modules
(that is things that are not distributed with the core of postgresql but
must be integrated to it, such as new types or new functions which deal
with backend informations).

The idea is that any external module could have a very simple makefile and
reuse all of postgresql build infrastructure (makefiles, scripts...) to
be build against an already installed postgresql.

I hope this is clearer,

have a nice day,

-- 
Fabien Coelho - coelho@cri.ensmp.fr