Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkh7z-0007ZI-IG for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Aug 2018 02:44:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fkh7x-0008Op-D3 for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Aug 2018 02:44:41 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkh7x-0008Oh-29 for pgsql-hackers@lists.postgresql.org; Wed, 01 Aug 2018 02:44:41 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fkh7q-0008NA-EH for pgsql-hackers@postgresql.org; Wed, 01 Aug 2018 02:44:39 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w712iWL5027745; Tue, 31 Jul 2018 22:44:32 -0400 From: Tom Lane To: Andrew Gierth cc: Peter Eisentraut , pgsql-hackers@postgresql.org Subject: Re: Should contrib modules install .h files? In-reply-to: <87d0v3atbm.fsf@news-spur.riddles.org.uk> References: <87y3euomjh.fsf@news-spur.riddles.org.uk> <87tvpinfr4.fsf@news-spur.riddles.org.uk> <63444.1530537990@sss.pgh.pa.us> <87lgatohzp.fsf@news-spur.riddles.org.uk> <63655.1530540982@sss.pgh.pa.us> <87h8lhoevw.fsf@news-spur.riddles.org.uk> <63819.1530544945@sss.pgh.pa.us> <878t6to8j9.fsf@news-spur.riddles.org.uk> <874lhho071.fsf@news-spur.riddles.org.uk> <67427.1530738056@sss.pgh.pa.us> <87po02m0bh.fsf@news-spur.riddles.org.uk> <87in5tnafh.fsf@news-spur.riddles.org.uk> <87efghn7js.fsf@news-spur.riddles.org.uk> <87a7r5n4n2.fsf@news-spur.riddles.org.uk> <87o9enb4h7.fsf@news-spur.riddles.org.uk> <86036c67-d76f-3dc0-a9f5-69e776b4ecc5@2ndquadrant.com> <87d0v3atbm.fsf@news-spur.riddles.org.uk> Comments: In-reply-to Andrew Gierth message dated "Wed, 01 Aug 2018 00:33:11 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <27743.1533091472.1@sss.pgh.pa.us> Date: Tue, 31 Jul 2018 22:44:32 -0400 Message-ID: <27744.1533091472@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andrew Gierth writes: > "Peter" == Peter Eisentraut writes: > Peter> I'm missing some guidance what an extension using those headers > Peter> is supposed to do. How does it get the right -I options? > If your extension is relying on pg11+, or you have checked the pg > version when constructing the makefile, you can just do: > PG_CPPFLAGS += -I$(includedir_server)/extension/hstore > and #include "hstore.h" will work. I remain of the opinion that it'd be smarter to do PG_CPPFLAGS += -I$(includedir_server)/extension then #include "hstore/hstore.h" This way requires fewer -I options and is far more robust against header name conflicts. regards, tom lane