Re: Reducing header interdependencies around heapam.h et al.
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Date: 2019-01-14T03:05:03Z
Lists: pgsql-hackers
Hi, On 2019-01-13 23:54:58 -0300, Alvaro Herrera wrote: > On 2019-Jan-13, Andres Freund wrote: > > > Alvaro, you'd introduced the split of HeapScanDesc and HeapScanDescData > > being in different files (in a3540b0f657c6352) - what do you think about > > this change? I didn't revert that split, but I think we ought to > > consider just relying on a forward declared struct in heapam.h instead, > > this split is pretty confusing and seems to lead to more interdependence > > in a lot of cases. > > I wasn't terribly happy with that split, so I'm not opposed to doing > things differently. For your consideration, I've had this patch lying > around for a few years, which (IIRC) reduces the exposure of heapam.h by > splitting relscan.h in two. This applies on top of dd778e9d8884 (and as > I recall it worked well there). You forgot to attach that patch... :). I'm not sure I see a need to split relscan - note my patch makes it so that it's not included by heapam.h anymore, and doing for the same for genam.h would be fairly straightforward. The most interesting bit there would be whether we'd add the includes necessary for Snapshot (imo no), Relation (?), ScanKey (imo no), or whether to add the necessary includes directly. > I'll try to have a look at your patch tomorrow. Thanks! Greetings, Andres Freund
Commits
-
Don't include genam.h from execnodes.h and relscan.h anymore.
- 0944ec54de38 12.0 landed
-
Make naming of tupdesc related structs more consistent with the rest of PG.
- 774a975c9a59 12.0 landed
-
Remove too generically named MissingPtr typedef.
- e451dd552196 12.0 landed
-
Don't include heapam.h from others headers.
- 4c850ecec649 12.0 landed