转自:http://blog.163.com/digoal@126/blog/static/16387704020122208374396/
If you are thinking about distributing your PostgreSQL extension modules, setting up a portable build system for them can be fairly difficult.
Therefore the PostgreSQL installation provides a build infrastructure for extensions, called PGXS,
so that simple extension modules can be built simply against an already installed server.
PGXS is mainly intended for extensions that include C code, although it can be used for pure-SQL extensions too.
Note that PGXS is not intended to be a universal build system framework that can be used to build any software interfacing to PostgreSQL;
it simply automates common build rules for simple server extension modules. For more complicated packages, you might need to write your own build system