postgresql extension API proof of concept

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: postgresql extension API proof of concept
Date: 2004-05-19 14:18:13
Message-ID: Pine.LNX.4.58.0405191613260.20575@sablons.cri.ensmp.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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(at)cri(dot)ensmp(dot)fr

Attachment Content-Type Size
install_build.patch text/plain 18.2 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2004-05-19 14:19:41 Re: Call for 7.5 feature completion
Previous Message Chris Browne 2004-05-19 14:08:50 AIX Compilation Fun with 7.5 CVS