summaryrefslogtreecommitdiff
path: root/src/backend/access/index/genam.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2019-01-14 15:54:18 -0800
committerAndres Freund <andres@anarazel.de>2019-01-14 16:24:41 -0800
commit4c850ecec649c1b1538c741b89cf65d8f7d61853 (patch)
tree616cd9ae1c2e1dd8e6d38de606e7133235964437 /src/backend/access/index/genam.c
parent42e2a580713201645d7caa4b27713ac777432d8d (diff)
downloadpostgresql-4c850ecec649c1b1538c741b89cf65d8f7d61853.tar.gz
Don't include heapam.h from others headers.
heapam.h previously was included in a number of widely used headers (e.g. execnodes.h, indirectly in executor.h, ...). That's problematic on its own, as heapam.h contains a lot of low-level details that don't need to be exposed that widely, but becomes more problematic with the upcoming introduction of pluggable table storage - it seems inappropriate for heapam.h to be included that widely afterwards. heapam.h was largely only included in other headers to get the HeapScanDesc typedef (which was defined in heapam.h, even though HeapScanDescData is defined in relscan.h). The better solution here seems to be to just use the underlying struct (forward declared where necessary). Similar for BulkInsertState. Another problem was that LockTupleMode was used in executor.h - parts of the file tried to cope without heapam.h, but due to the fact that it indirectly included it, several subsequent violations of that goal were not not noticed. We could just reuse the approach of declaring parameters as int, but it seems nicer to move LockTupleMode to lockoptions.h - that's not a perfect location, but also doesn't seem bad. As a number of files relied on implicitly included heapam.h, a significant number of files grew an explicit include. It's quite probably that a few external projects will need to do the same. Author: Andres Freund Reviewed-By: Alvaro Herrera Discussion: https://postgr.es/m/20190114000701.y4ttcb74jpskkcfb@alap3.anarazel.de
Diffstat (limited to 'src/backend/access/index/genam.c')
-rw-r--r--src/backend/access/index/genam.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/access/index/genam.c b/src/backend/access/index/genam.c
index 4d46257d6a..e632ad0a9b 100644
--- a/src/backend/access/index/genam.c
+++ b/src/backend/access/index/genam.c
@@ -19,6 +19,7 @@
#include "postgres.h"
+#include "access/heapam.h"
#include "access/relscan.h"
#include "access/transam.h"
#include "catalog/index.h"