Re: Removing #include "postgres.h" from a couple of headers

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Removing #include "postgres.h" from a couple of headers
Date: 2017-03-08 14:33:55
Message-ID: 19978.1488983635@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Wed, Mar 8, 2017 at 3:55 AM, Thomas Munro
> <thomas(dot)munro(at)enterprisedb(dot)com> wrote:
>> There are also instances in regcustom.h and snowball's header.h -- are
>> those special cases?

> I will leave this question to someone wiser (or more self-assured) than I.

I'm pretty sure I'm to blame for both of those special cases. The genesis
of both is that we are including these headers from externally-generated
.c files, and it seemed like modifying the .c files would be a bigger
problem than violating the policy. I am not sure if I hold that position
anymore for the regexp library; our copy has diverged substantially from
Tcl's anyway. It's still an issue for Snowball, because those .c files
are actually machine-generated by a Snowball-to-C compiler. We haven't
modified them and probably shouldn't.

If we don't change the code layout, we should probably at least add
comments near these postgres.h inclusions explaining why they're violating
policy.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2017-03-08 14:53:50 Re: Removing #include "postgres.h" from a couple of headers
Previous Message Dilip Kumar 2017-03-08 14:10:24 Re: Parallel bitmap heap scan