atom feed19 messages in org.postgresql.pgsql-hackersRe: Frustrating issue with PGXS
FromSent OnAttachments
Eddie StanleyJun 25, 2007 4:42 am 
Magnus HaganderJun 25, 2007 5:08 am 
Tom LaneJun 25, 2007 7:43 am 
Magnus HaganderJun 25, 2007 7:49 am 
Tom LaneJun 25, 2007 8:08 am 
Fabien COELHOJun 25, 2007 10:56 am 
Tom LaneJun 25, 2007 11:02 am 
Fabien COELHOJun 25, 2007 11:34 am 
Fabien COELHOJun 25, 2007 11:46 am 
Tom LaneJun 25, 2007 12:14 pm 
Fabien COELHOJun 26, 2007 4:11 am.patch
Tom LaneJun 26, 2007 7:11 am 
Fabien COELHOJun 26, 2007 7:42 am 
Tom LaneJun 26, 2007 3:09 pm 
Fabien COELHOJun 27, 2007 12:53 am 
Peter EisentrautJun 27, 2007 1:30 am 
Fabien COELHOJun 27, 2007 4:02 am 
Tom LaneJun 27, 2007 7:09 am 
Tom LaneJun 27, 2007 7:12 am 
Subject:Re: Frustrating issue with PGXS
From:Tom Lane (tg@sss.pgh.pa.us)
Date:Jun 26, 2007 3:09:48 pm
List:org.postgresql.pgsql-hackers

Fabien COELHO <coe@cri.ensmp.fr> writes:

Some documentation (not just code) update seems important to me.

Agreed. I added this to xfunc.sgml's discussion of PGXS makefiles:

Index: doc/src/sgml/xfunc.sgml =================================================================== RCS file: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v retrieving revision 1.128 diff -c -r1.128 xfunc.sgml *** doc/src/sgml/xfunc.sgml 6 Jun 2007 23:00:36 -0000 1.128 --- doc/src/sgml/xfunc.sgml 26 Jun 2007 21:57:43 -0000 *************** *** 2071,2080 **** DATA_built = isbn_issn.sql DOCS = README.isbn_issn

! PGXS := $(shell pg_config --pgxs) include $(PGXS) </programlisting> ! The last two lines should always be the same. Earlier in the file, you assign variables or add custom <application>make</application> rules. </para> --- 2071,2081 ---- DATA_built = isbn_issn.sql DOCS = README.isbn_issn

! PG_CONFIG = pg_config ! PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) </programlisting> ! The last three lines should always be the same. Earlier in the file, you assign variables or add custom <application>make</application> rules. </para> *************** *** 2215,2220 **** --- 2216,2233 ---- </para> </listitem> </varlistentry> + + <varlistentry> + <term><varname>PG_CONFIG</varname></term> + <listitem> + <para> + path to <application>pg_config</> program for the + <productname>PostgreSQL</productname> installation to build against + (typically just <literal>pg_config</> to use the first one in your + <varname>PATH</>) + </para> + </listitem> + </varlistentry> </variablelist> </para>

*************** *** 2222,2234 **** Put this makefile as <literal>Makefile</literal> in the directory which holds your extension. Then you can do <literal>make</literal> to compile, and later <literal>make ! install</literal> to install your module. The extension is compiled and installed for the <productname>PostgreSQL</productname> installation that ! corresponds to the first <command>pg_config</command> command ! found in your path. </para>

<para> The scripts listed in the <varname>REGRESS</> variable are used for regression testing of your module, just like <literal>make --- 2235,2260 ---- Put this makefile as <literal>Makefile</literal> in the directory which holds your extension. Then you can do <literal>make</literal> to compile, and later <literal>make ! install</literal> to install your module. By default, the extension is compiled and installed for the <productname>PostgreSQL</productname> installation that ! corresponds to the first <command>pg_config</command> program ! found in your path. You can use a different installation by ! setting <varname>PG_CONFIG</varname> to point to its ! <command>pg_config</command> program, either within the makefile ! or on the <literal>make</literal> command line. </para>

+ <caution> + <para> + Changing <varname>PG_CONFIG</varname> only works when building + against <productname>PostgreSQL</productname> 8.3 or later. + With older releases it does not work to set it to anything except + <literal>pg_config</>; you must alter your <varname>PATH</> + to select the installation to build against. + </para> + </caution> + <para> The scripts listed in the <varname>REGRESS</> variable are used for regression testing of your module, just like <literal>make

It might be worth backpatching the Makefile.global.in patch (ie, the ifndef addition) to the 8.2 branch, which would allow us to say "8.2.5 or later" instead of "8.3 or later", and would bring correspondingly nearer the time when people can actually use the feature without thinking much. Comments?