avoid including rel.h in execnodes.h

Lists: pgsql-hackers
From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: avoid including rel.h in execnodes.h
Date: 2011-06-29 23:20:37
Message-ID: 1309389154-sup-4246@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

This simple patch moves two struct declarations (Trigger and
TriggerDesc) from rel.h into a new file, reltrigger.h. The benefit is
that execnodes.h only needs to include the latter. Since execnodes.h is
very widely included, this change means there are less files that
indirectly include rel.h now, which is a good thing because rel.h
includes a ton of other files. (Of course, rel.h itself needs to
include the new header).

I also included rel.h in spi.h, because it was previously indirectly
included via execnodes.h and with this patch it would no longer be,
which is a problem because it'd cause external code to fail to compile.

--
Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>

Attachment Content-Type Size
0001-Move-Trigger-and-TriggerDesc-structs-out-of-rel.h-in.patch application/octet-stream 25.1 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: avoid including rel.h in execnodes.h
Date: 2011-07-01 22:20:50
Message-ID: 6478.1309558850@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:
> This simple patch moves two struct declarations (Trigger and
> TriggerDesc) from rel.h into a new file, reltrigger.h. The benefit is
> that execnodes.h only needs to include the latter. Since execnodes.h is
> very widely included, this change means there are less files that
> indirectly include rel.h now, which is a good thing because rel.h
> includes a ton of other files. (Of course, rel.h itself needs to
> include the new header).

OK ...

> I also included rel.h in spi.h, because it was previously indirectly
> included via execnodes.h and with this patch it would no longer be,
> which is a problem because it'd cause external code to fail to compile.

If we think that not including rel.h unnecessarily is a good thing, then
that should surely apply to external code as well. So -1 for that bit.
It's not like we have not removed stuff from spi.h before.

regards, tom lane


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: avoid including rel.h in execnodes.h
Date: 2011-07-04 19:24:42
Message-ID: 1309807428-sup-7621@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Excerpts from Tom Lane's message of vie jul 01 18:20:50 -0400 2011:
> Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org> writes:

> > I also included rel.h in spi.h, because it was previously indirectly
> > included via execnodes.h and with this patch it would no longer be,
> > which is a problem because it'd cause external code to fail to compile.
>
> If we think that not including rel.h unnecessarily is a good thing, then
> that should surely apply to external code as well. So -1 for that bit.
> It's not like we have not removed stuff from spi.h before.

Thanks, committed with that change.

--
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support