Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Upcn0-00054x-GX for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Jun 2013 11:12:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Upcmz-0003SR-SD for pgsql-hackers@arkaria.postgresql.org; Thu, 20 Jun 2013 11:12:29 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Upcmy-0003SK-8q for pgsql-hackers@postgresql.org; Thu, 20 Jun 2013 11:12:28 +0000 Received: from moutng.kundenserver.de ([212.227.17.10]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Upcmn-0007De-OY for pgsql-hackers@postgresql.org; Thu, 20 Jun 2013 11:12:27 +0000 Received: from obelix.localnet (AToulouse-556-1-274-157.w90-45.abo.wanadoo.fr [90.45.62.157]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0LbO0s-1UQi6G0KYU-00lDhl; Thu, 20 Jun 2013 13:12:14 +0200 From: =?utf-8?q?C=C3=A9dric_Villemain?= Reply-To: cedric@2ndquadrant.com Organization: 2ndQuadrant To: pgsql-hackers@postgresql.org Subject: Re: Bugfix and new feature for PGXS Date: Thu, 20 Jun 2013 13:12:32 +0200 User-Agent: KMail/1.13.7 (Linux/3.8-2-amd64; KDE/4.8.4; x86_64; ; ) Cc: Peter Eisentraut , Andrew Dunstan , Craig Ringer References: <201306181552.36673.cedric@2ndquadrant.com> <201306192058.23832.cedric@2ndquadrant.com> <1371698781.13762.48.camel@vanquo.pezone.net> In-Reply-To: <1371698781.13762.48.camel@vanquo.pezone.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart10321261.T6sbM6skSC"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <201306201312.35493.cedric@2ndquadrant.com> X-Provags-ID: V02:K0:NmVhyjVyShn2jByqrX3+lyyNPj4d7NfUY9AxA2EakLF L5U4m49679cPjUtAMVCYgthO9iMxoNt74iV94KjAVaUTkrRXDL qLFwetseNgk25+3kmGASGd31P7RvhvCe3lV0mxyoAf83bebysm KNTADu/rzKZ61P+I1PWbu3AJ5Ugcpf2+Knjqvu8wksRHWAL/h4 vA1ID5Kv2aSpSbujymoY9l3/dx6y33p//3k63gs2c7Rv+6asfA yPpQ7fVi9ucquAHJqaTBS8rPha04mu04dAB62GP7Svcjt3vb21 YGqJ16oj33gNAaLJg+BcAvOQYCVKW63cK4ujcOSZynzyn1WNBZ Jp57Ez7GNC1+a5Uyn7mBsrFTo5UB8SmbXaPnx/k+4 X-Pg-Spam-Score: -0.0 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --nextPart10321261.T6sbM6skSC Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Le jeudi 20 juin 2013 05:26:21, Peter Eisentraut a =C3=A9crit : > On Wed, 2013-06-19 at 20:58 +0200, C=C3=A9dric Villemain wrote: > > I believe he answered the proposal to put all headers on the same flat > > directory, instead of a tree. >=20 > The headers are used as >=20 > #include "hstore.h" > #include "ltree.h" > etc. >=20 > in the existing source code. >=20 > If you want to install the for use by others, you can do one of three > things: >=20 > 1) Install them into $(pg_config --includedir-server), so other users > will just include them in the same way as shown above. I don't like this one because extension can overwrite sever headers. > 2) Install them in a different directory, but keep the same #include > lines. That would require PGXS changes, perhaps a new pg_config option, > or something that produces the right -I option to find them. Patch of PGXS is not a problem. pg_config patch is a requirement only if users set their own=20 $(includedir_contrib) variable. I didn't though about it, but it is probabl= y=20 better to add that. This looks trivial too. To include hstore header we write =C2=AB#include "hstore.h"=C2=BB but we ad= d : -I$(includedir_contrib)/hstore to the FLAGS in the extension makefile whic= h=20 does require hstore. It changes nothing to hstore Makefile itself. The main difference is that before we had to -I$(top_srcdir)/../contrib/hst= ore=20 *iff* we are not building with PGXS (else we need to have the hstore source= =20 available somewhere), now we can do -I$(includedir_contrib)/hstore with PGX= S=20 (hstore need to be installed first, as we USE_PGXS) Then PGXS offers to catch both case transparently so we can do : =2DI${include_contrib_header) in Makefile and pgxs.mk takes care of adjusting include_contrib_header (or whatever its= =20 name) according to USE_PGXS value. > 3) Install them in a different directory and require a different > #include line. But then you have to change the existing uses as well, > which would probably require moving files around. Having to change existing source code do keep the same behavior is not=20 attractive at all. > Both 2 and 3 require a lot of work, possibly compatibility breaks, for > no obvious reason. 2 is a good solution and not a lot of work, IMO. Removing the need of setting -I$(include...) in the contrib Makefile can be= =20 done later by adding a PGXS variable to define the contrib requirements, th= is=20 is something different from the current feature (build contrib depending on= =20 another(s) without full source tree) =2D-=20 C=C3=A9dric Villemain +33 (0)6 20 30 22 52 http://2ndQuadrant.fr/ PostgreSQL: Support 24x7 - D=C3=A9veloppement, Expertise et Formation --nextPart10321261.T6sbM6skSC Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (GNU/Linux) iQEcBAABAgAGBQJRwuOjAAoJENsgH0yzVBebQ/oH/3EH82lP4Es/Y462ZqScTV5a W/Vir/vqRMSnA4NqU0n+dxHsFfY82zr8BvqhM+9iEh8rkS0mjqQiVQKkuq92NlJj EUdfjsU7YI9fiBdQgOf2rqa11E8hwT8DFHsAPWeDuPDE80cDPcz4IRj8UAD3azrs P3ykZ2P7uBf+NPyfzI6fDTIYyPWqSk79++ALK0uxiwcD5QNqjd4/IaxucHp8GiZZ etduv+khWwjHY0BaNJmvoqqOgVpiWlMbm0GuaUK/w7xOMMKum4whDKZ9DcRh1BiE m1dP1KU04vIMTP5loTajzgr7AzQRibJ15tp2/YCXVboTHEhYdDYegSM4rZlNlPI= =HwWF -----END PGP SIGNATURE----- --nextPart10321261.T6sbM6skSC--