pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Andres Freund <andres@anarazel.de>
Cc: Thomas Munro <thomas.munro@enterprisedb.com>
Cc: Rafia Sabih <rafia.sabih@enterprisedb.com>
Cc: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: Peter Geoghegan <pg@heroku.com>
Cc: Haribabu Kommi <kommi.haribabu@gmail.com>
Cc: Pg Hackers <pgsql-hackers@postgresql.org>
Subject: Re: WIP: [[Parallel] Shared] Hash
Date: Tue, 07 Mar 2017 19:15:28 -0500
Message-ID: <11634.1488932128@sss.pgh.pa.us> (raw)
In-Reply-To: <20170307235854.rjmpiza6ztfy5wmm@alap3.anarazel.de>
References: <CAEepm=1PhZD0xhhmYKgSk7948K18JkRwCUy2uFtjJYiUzXjnWg@mail.gmail.com>
	<CAFjFpReeHV+nyroU11M98yBRB5yzcsvs0ppr5mdJv6nbewTfsg@mail.gmail.com>
	<CAOGQiiMw9PLTO=wmXAOfzYRJSLzr=aMJp2ST6-bCaCBbV01XBg@mail.gmail.com>
	<CAEepm=11Y8veLFZhT7MfgCbDoYnJY50x_csF4XjbJYq94-e_YQ@mail.gmail.com>
	<CAOGQiiNk5Uri44t+jS5Z3rMTEKshhcTdDEB33JRM=kYSXNwpYw@mail.gmail.com>
	<CAEepm=2PRCtpo6UL4RxSbp=OXpyty0dg3oT3Vyk0eb=r8JwZhg@mail.gmail.com>
	<20170216023617.eszzvg2daiarhqpu@alap3.anarazel.de>
	<CAEepm=09rrc0YNJYjgFVdOR67g1qqtmfPf5tWYK9+_n6LyQjbA@mail.gmail.com>
	<CAEepm=3mGRTGkJ=gnCoy+3OrhsibFuA3CNLDEfco=rLMPJKgNA@mail.gmail.com>
	<CAEepm=3g=dMG+84083fkFzLvgMJ7HdhbGB=AeZABNukbZm3hpA@mail.gmail.com>
	<20170307235854.rjmpiza6ztfy5wmm@alap3.anarazel.de>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Andres Freund <andres@anarazel.de> 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



view thread (83+ messages)  latest in thread

Message-ID: <11634.1488932128@sss.pgh.pa.us>
Permalink:  ../11634.1488932128@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/11634.1488932128@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, andres@anarazel.de, thomas.munro@enterprisedb.com, rafia.sabih@enterprisedb.com, ashutosh.bapat@enterprisedb.com, pg@heroku.com, kommi.haribabu@gmail.com
  Subject: Re: WIP: [[Parallel] Shared] Hash
  In-Reply-To: <11634.1488932128@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox