Skip site navigation (1) Skip section navigation (2)

pgxs: build infrastructure for extensions v1

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: pgxs: build infrastructure for extensions v1
Date: 2004-05-24 15:52:12
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-patches
Dear patchers,

Please find attached a patch which provides a working infrastructure for
pg extensions such as new gist-based indexes, functions, types...

The infrastructure is a simple reworking of the already available internal
infrastructure for contrib, so that it can be used outside of the
postgresql source tree after installation, without gory details being in
sight of the user...

As a test case and show how, I provided new Makefile.pgxs for most contrib
subdirectories. After postgresql has been configure, compiled and
installed, simply try them with:

	"cd contrib/foo ; make -f Makefile.pgxs install"

BEWARE: The patch does not include an update of "configure", as I do not
have the same version of "autoconf". So configure must be regenerated:
"autoconf > configure"

There is an initial documentation in "pgxs.sgml".

How it works:

 - necessary files (includes, scripts, makefiles...) are copied in lib/build
   on the initial "make install". The adds 2MB of stuff. The former
   installation can be obtained with "make light-install", but then
   no extensions could be added to the installation, so this is more for
   packagers that would like to provide a separate -dev package, IMHO.

   Due to gnu-make restriction on how its includes work, these files must
   be copied with the same directory structure as the pg source tree.
   The fact does not appear at all in the actual infrastructure from the
   user point of view, but it explains why subdirectories are necessary
   under the build subdir...

 - the makefile of any extension is expected to set macro PGXS to
   "pg_config --pgxs", to include a special makefile, and to
   set some macros depending on what is to be built, just like in
   current contrib. See the examples under contrib.

 - I've added two PGXS-triggered conditionnals in,
   so that includes and libraries are taken where needed...

It works for me.

Questions and thoughts:

 - maybe more files should be copied? if so, which ones?

 - should this actually replace the current "contrib" infrastructure?

   I would tend to say "yes"...  that would require to replace all makefiles
   there by the Makefile.pgxs version, to remove "", and
   also possibly to update some documentations.

 - more documentation?
   integration of the documentation wrt pg doc?

 - validation? one could thing of installing some contribs
   when "make check" is performed, so as to validate that the
   extension infrastructure is not broken?

Have a nice day,

Fabien Coelho - coelho(at)cri(dot)ensmp(dot)fr

Attachment: install_build.patch
Description: text/plain (40.6 KB)


pgsql-patches by date

Next:From: ssingerDate: 2004-05-24 16:32:21
Subject: contrib/dbmirror typo fix
Previous:From: Oliver JowettDate: 2004-05-24 15:03:29
Subject: delayed planning of unnamed statements

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group