pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feedUnnecessary #include in objectaddress.h?
3+ messages / 2 participants
[nested] [flat]
* Unnecessary #include in objectaddress.h?
@ 2015-07-20 21:10 Adam Brightwell <adam.brightwell@crunchydatasolutions.com>
2015-07-20 22:10 ` Re: Unnecessary #include in objectaddress.h? Alvaro Herrera <alvherre@2ndquadrant.com>
0 siblings, 1 reply; 3+ messages in thread
From: Adam Brightwell @ 2015-07-20 21:10 UTC (permalink / raw)
To: pgsql-hackers
All,
While looking at the include dependency graph for objectaddress.h:
http://doxygen.postgresql.org/objectaddress_8h.html
I saw that pg_list.h is both included and inherited (through multiple
paths) by objectaddress.h. Perhaps this doesn't matter, but I thought
I would at least bring it up and propose removing this redundant
#include from objectaddress.h.
If it makes sense to do so, I have attached a patch that removes it.
Thanks,
Adam
--
Adam Brightwell - adam.brightwell@crunchydatasolutions.com
Database Engineer - www.crunchydatasolutions.com
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
Attachments:
[text/x-patch] objectaddress-include-cleanup.patch (428B, ../../CAKRt6CT6Av0SdRWK76yA8_YPfkWZC=UhNXOZnOccvR1bYweDjA@mail.gmail.com/2-objectaddress-include-cleanup.patch)
download | inline diff:
diff --git a/src/include/catalog/objectaddress.h b/src/include/catalog/objectaddress.h
new file mode 100644
index 37808c0..432cbe8
*** a/src/include/catalog/objectaddress.h
--- b/src/include/catalog/objectaddress.h
***************
*** 13,19 ****
#ifndef OBJECTADDRESS_H
#define OBJECTADDRESS_H
- #include "nodes/pg_list.h"
#include "storage/lock.h"
#include "utils/acl.h"
#include "utils/relcache.h"
--- 13,18 ----
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Unnecessary #include in objectaddress.h?
2015-07-20 21:10 Unnecessary #include in objectaddress.h? Adam Brightwell <adam.brightwell@crunchydatasolutions.com>
@ 2015-07-20 22:10 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2015-07-20 23:05 ` Re: Unnecessary #include in objectaddress.h? Adam Brightwell <adam.brightwell@crunchydatasolutions.com>
0 siblings, 1 reply; 3+ messages in thread
From: Alvaro Herrera @ 2015-07-20 22:10 UTC (permalink / raw)
To: Adam Brightwell <adam.brightwell@crunchydatasolutions.com>; +Cc: pgsql-hackers
Adam Brightwell wrote:
> All,
>
> While looking at the include dependency graph for objectaddress.h:
>
> http://doxygen.postgresql.org/objectaddress_8h.html
>
> I saw that pg_list.h is both included and inherited (through multiple
> paths) by objectaddress.h. Perhaps this doesn't matter, but I thought
> I would at least bring it up and propose removing this redundant
> #include from objectaddress.h.
I wondered whether to bother about this kind of thing for a while. It
doesn't have any practical impact immediately, because obviously
pg_list.h is still included indirectly by objectaddress.h (via lock.h in
this case IIRC). If we made some restructuring that caused the other
header not to include pg_list.h anymore, that would make objectaddress.h
broken -- unless objectaddress.h itself no longer needed pg_list.h.
We've had in previous rounds whole iterations on a "pgrminclude" script
that does this kind of thing, but the breakage after each such run is
large.
All in all, I wouldn't bother unless there is an actual change.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Unnecessary #include in objectaddress.h?
2015-07-20 21:10 Unnecessary #include in objectaddress.h? Adam Brightwell <adam.brightwell@crunchydatasolutions.com>
2015-07-20 22:10 ` Re: Unnecessary #include in objectaddress.h? Alvaro Herrera <alvherre@2ndquadrant.com>
@ 2015-07-20 23:05 ` Adam Brightwell <adam.brightwell@crunchydatasolutions.com>
0 siblings, 0 replies; 3+ messages in thread
From: Adam Brightwell @ 2015-07-20 23:05 UTC (permalink / raw)
To: Alvaro Herrera <alvherre@2ndquadrant.com>; +Cc: pgsql-hackers
> I wondered whether to bother about this kind of thing for a while. It
> doesn't have any practical impact immediately, because obviously
> pg_list.h is still included indirectly by objectaddress.h (via lock.h in
> this case IIRC). If we made some restructuring that caused the other
> header not to include pg_list.h anymore, that would make objectaddress.h
> broken -- unless objectaddress.h itself no longer needed pg_list.h.
>
> We've had in previous rounds whole iterations on a "pgrminclude" script
> that does this kind of thing, but the breakage after each such run is
> large.
>
> All in all, I wouldn't bother unless there is an actual change.
Understood. Thanks.
-Adam
--
Adam Brightwell - adam.brightwell@crunchydatasolutions.com
Database Engineer - www.crunchydatasolutions.com
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2015-07-20 23:05 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-07-20 21:10 Unnecessary #include in objectaddress.h? Adam Brightwell <adam.brightwell@crunchydatasolutions.com>
2015-07-20 22:10 ` Alvaro Herrera <alvherre@2ndquadrant.com>
2015-07-20 23:05 ` Adam Brightwell <adam.brightwell@crunchydatasolutions.com>
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