This is looking attractive.
Please don't #include postgres.h in partcache.h. That's per policy.
Why do you need to #include parsenodes.h in partcache.h?
I think rewriteManip.h can do with just relcache.h rather than rel.h
(probably partition.h can do likewise)
thanks
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services