Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1clPGT-000355-Ja for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Mar 2017 00:15:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1clPGT-0001Zm-66 for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Mar 2017 00:15:37 +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.84_2) (envelope-from ) id 1clPGS-0001Wq-BO for pgsql-hackers@postgresql.org; Wed, 08 Mar 2017 00:15:36 +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.84_2) (envelope-from ) id 1clPGP-0007Gk-9o for pgsql-hackers@postgresql.org; Wed, 08 Mar 2017 00:15:35 +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 v280FSIh011635; Tue, 7 Mar 2017 19:15:28 -0500 From: Tom Lane To: Andres Freund cc: Thomas Munro , Rafia Sabih , Ashutosh Bapat , Peter Geoghegan , Haribabu Kommi , Pg Hackers Subject: Re: WIP: [[Parallel] Shared] Hash In-reply-to: <20170307235854.rjmpiza6ztfy5wmm@alap3.anarazel.de> References: <20170216023617.eszzvg2daiarhqpu@alap3.anarazel.de> <20170307235854.rjmpiza6ztfy5wmm@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Tue, 07 Mar 2017 15:58:54 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11633.1488932128.1@sss.pgh.pa.us> Date: Tue, 07 Mar 2017 19:15:28 -0500 Message-ID: <11634.1488932128@sss.pgh.pa.us> X-Pg-Spam-Score: -1.9 (-) 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 Andres Freund writes: > +++ b/src/include/storage/barrier.h > +#include "postgres.h" > Huh, that normally shouldn't be in a header. I see you introduced that > in a bunch of other places too - that really doesn't look right to me. That is absolutely not project style and is not acceptable. The core reason why not is that postgres.h/postgres_fe.h/c.h have to be the *first* inclusion in every compilation, for arcane portability reasons you really don't want to know about. (Suffice it to say that on some platforms, stdio.h isn't all that std.) Our coding rule for that is that we put the appropriate one of these first in every .c file, while .h files always assume that it's been included already. As soon as you break that convention, it becomes unclear from looking at a .c file whether the ordering requirement has been satisfied. Also, since now you've moved the must-be-first requirement to some other header file(s), you risk breakage when somebody applies another project convention about alphabetizing #include references for all headers other than those magic ones. In short, don't even think of doing this. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers