some more include removal from headers

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: some more include removal from headers
Date: 2026-03-13 13:05:24
Message-ID: 202603131240.ihwqdxnj7w2o@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello,

execnodes.h is a very large source of other headers for no very good
reasons anymore. Fortunately there's a few of the files it includes
that we can remove very easily with just a small number of additional
typedefs. Some proposed patches attached; it's all very
straightforward, just add typedefs for structs
Tuplesortstate
Tuplestorestate
TupleConversionMap
TupleTableSlot
TupleTableSlotOps
TIDBitmap
This also requires to add some headers to a bunch of .c files, which is
a good indicator that we're making progress.

It's especially nice when the new #include line we have to add in some
.c file is not the one that was removed from the .h file -- for instance
in 0001 we have to add pg_type_d.h when removing tuplestore.h/
tuplesort.h, and if you look at the chart here
https://doxygen.postgresql.org/tuplesort_8h.html it becomes very clear
we're saving quite a lot of useless indirect inclusions. (This is also
seen in 0004: we remove tuptable.h and have to add sysattr.h to three .c
files).

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"You don't solve a bad join with SELECT DISTINCT" #CupsOfFail
https://twitter.com/connor_mc_d/status/1431240081726115845

Attachment Content-Type Size
0001-remove-tuplestore.h-and-tuplesort.h-from-execnodes.h.patch text/x-diff 26.6 KB
0002-remove-tupconvert.h-from-execnodes.h.patch text/x-diff 7.1 KB
0003-don-t-include-sharedtuplestore.h-in-execnodes.h.patch text/x-diff 4.6 KB
0004-don-t-include-tuptable.h-in-execnodes.h.patch text/x-diff 2.7 KB
0005-don-t-include-tidbitmap.h-in-execnodes.h.patch text/x-diff 2.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2026-03-13 13:14:12 Re: Add a check for interrupts in ginInsert
Previous Message Alena Rybakina 2026-03-13 13:04:24 Re: Vacuum statistics