diff options
author | Andres Freund <andres@anarazel.de> | 2019-01-14 15:54:18 -0800 |
---|---|---|
committer | Andres Freund <andres@anarazel.de> | 2019-01-14 16:24:41 -0800 |
commit | 4c850ecec649c1b1538c741b89cf65d8f7d61853 (patch) | |
tree | 616cd9ae1c2e1dd8e6d38de606e7133235964437 /contrib | |
parent | 42e2a580713201645d7caa4b27713ac777432d8d (diff) | |
download | postgresql-4c850ecec649c1b1538c741b89cf65d8f7d61853.tar.gz postgresql-4c850ecec649c1b1538c741b89cf65d8f7d61853.zip |
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 'contrib')
-rw-r--r-- | contrib/amcheck/verify_nbtree.c | 1 | ||||
-rw-r--r-- | contrib/dblink/dblink.c | 1 | ||||
-rw-r--r-- | contrib/file_fdw/file_fdw.c | 1 | ||||
-rw-r--r-- | contrib/pageinspect/btreefuncs.c | 1 | ||||
-rw-r--r-- | contrib/pageinspect/heapfuncs.c | 1 | ||||
-rw-r--r-- | contrib/pageinspect/rawpage.c | 1 | ||||
-rw-r--r-- | contrib/pg_freespacemap/pg_freespacemap.c | 1 | ||||
-rw-r--r-- | contrib/pg_visibility/pg_visibility.c | 1 | ||||
-rw-r--r-- | contrib/pgrowlocks/pgrowlocks.c | 1 | ||||
-rw-r--r-- | contrib/pgstattuple/pgstatapprox.c | 1 | ||||
-rw-r--r-- | contrib/pgstattuple/pgstattuple.c | 1 | ||||
-rw-r--r-- | contrib/postgres_fdw/postgres_fdw.c | 1 | ||||
-rw-r--r-- | contrib/tsm_system_rows/tsm_system_rows.c | 1 | ||||
-rw-r--r-- | contrib/tsm_system_time/tsm_system_time.c | 1 |
14 files changed, 14 insertions, 0 deletions
diff --git a/contrib/amcheck/verify_nbtree.c b/contrib/amcheck/verify_nbtree.c index a8a0ec70e1a..055bfa05707 100644 --- a/contrib/amcheck/verify_nbtree.c +++ b/contrib/amcheck/verify_nbtree.c @@ -23,6 +23,7 @@ */ #include "postgres.h" +#include "access/heapam.h" #include "access/htup_details.h" #include "access/nbtree.h" #include "access/transam.h" diff --git a/contrib/dblink/dblink.c b/contrib/dblink/dblink.c index bf2a6c343d3..203f6fd3f01 100644 --- a/contrib/dblink/dblink.c +++ b/contrib/dblink/dblink.c @@ -38,6 +38,7 @@ #include "access/htup_details.h" #include "access/reloptions.h" +#include "access/heapam.h" #include "catalog/indexing.h" #include "catalog/namespace.h" #include "catalog/pg_foreign_data_wrapper.h" diff --git a/contrib/file_fdw/file_fdw.c b/contrib/file_fdw/file_fdw.c index 9ff34b4357f..ad4da6b5ed4 100644 --- a/contrib/file_fdw/file_fdw.c +++ b/contrib/file_fdw/file_fdw.c @@ -18,6 +18,7 @@ #include "access/htup_details.h" #include "access/reloptions.h" #include "access/sysattr.h" +#include "access/heapam.h" #include "catalog/pg_authid.h" #include "catalog/pg_foreign_table.h" #include "commands/copy.h" diff --git a/contrib/pageinspect/btreefuncs.c b/contrib/pageinspect/btreefuncs.c index 184ac62255c..454e488f86a 100644 --- a/contrib/pageinspect/btreefuncs.c +++ b/contrib/pageinspect/btreefuncs.c @@ -30,6 +30,7 @@ #include "pageinspect.h" #include "access/nbtree.h" +#include "access/heapam.h" #include "catalog/namespace.h" #include "catalog/pg_am.h" #include "funcapi.h" diff --git a/contrib/pageinspect/heapfuncs.c b/contrib/pageinspect/heapfuncs.c index a0c703750a5..b98c4881ac5 100644 --- a/contrib/pageinspect/heapfuncs.c +++ b/contrib/pageinspect/heapfuncs.c @@ -27,6 +27,7 @@ #include "pageinspect.h" +#include "access/heapam.h" #include "access/htup_details.h" #include "funcapi.h" #include "catalog/pg_type.h" diff --git a/contrib/pageinspect/rawpage.c b/contrib/pageinspect/rawpage.c index abd17d331bd..2d91954cb7d 100644 --- a/contrib/pageinspect/rawpage.c +++ b/contrib/pageinspect/rawpage.c @@ -18,6 +18,7 @@ #include "pageinspect.h" #include "access/htup_details.h" +#include "access/heapam.h" #include "catalog/namespace.h" #include "catalog/pg_type.h" #include "funcapi.h" diff --git a/contrib/pg_freespacemap/pg_freespacemap.c b/contrib/pg_freespacemap/pg_freespacemap.c index 7d939a7d207..5ad68005573 100644 --- a/contrib/pg_freespacemap/pg_freespacemap.c +++ b/contrib/pg_freespacemap/pg_freespacemap.c @@ -8,6 +8,7 @@ */ #include "postgres.h" +#include "access/heapam.h" #include "funcapi.h" #include "storage/freespace.h" diff --git a/contrib/pg_visibility/pg_visibility.c b/contrib/pg_visibility/pg_visibility.c index 210224e8e14..22adca18e64 100644 --- a/contrib/pg_visibility/pg_visibility.c +++ b/contrib/pg_visibility/pg_visibility.c @@ -10,6 +10,7 @@ */ #include "postgres.h" +#include "access/heapam.h" #include "access/htup_details.h" #include "access/visibilitymap.h" #include "catalog/pg_type.h" diff --git a/contrib/pgrowlocks/pgrowlocks.c b/contrib/pgrowlocks/pgrowlocks.c index 94e051d642b..fffee6e27e0 100644 --- a/contrib/pgrowlocks/pgrowlocks.c +++ b/contrib/pgrowlocks/pgrowlocks.c @@ -24,6 +24,7 @@ #include "postgres.h" +#include "access/heapam.h" #include "access/multixact.h" #include "access/relscan.h" #include "access/xact.h" diff --git a/contrib/pgstattuple/pgstatapprox.c b/contrib/pgstattuple/pgstatapprox.c index ca8ccc360d1..9729d8eb1bd 100644 --- a/contrib/pgstattuple/pgstatapprox.c +++ b/contrib/pgstattuple/pgstatapprox.c @@ -13,6 +13,7 @@ #include "postgres.h" #include "access/visibilitymap.h" +#include "access/heapam.h" #include "access/transam.h" #include "access/xact.h" #include "access/multixact.h" diff --git a/contrib/pgstattuple/pgstattuple.c b/contrib/pgstattuple/pgstattuple.c index 6d67bd8271c..8f67c3c2209 100644 --- a/contrib/pgstattuple/pgstattuple.c +++ b/contrib/pgstattuple/pgstattuple.c @@ -26,6 +26,7 @@ #include "access/gist_private.h" #include "access/hash.h" +#include "access/heapam.h" #include "access/nbtree.h" #include "access/relscan.h" #include "catalog/namespace.h" diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index e0c68dc6b4c..64efbdff082 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -14,6 +14,7 @@ #include "postgres_fdw.h" +#include "access/heapam.h" #include "access/htup_details.h" #include "access/sysattr.h" #include "catalog/pg_class.h" diff --git a/contrib/tsm_system_rows/tsm_system_rows.c b/contrib/tsm_system_rows/tsm_system_rows.c index 2dc14461cdc..69944f61c8d 100644 --- a/contrib/tsm_system_rows/tsm_system_rows.c +++ b/contrib/tsm_system_rows/tsm_system_rows.c @@ -28,6 +28,7 @@ #include "postgres.h" +#include "access/heapam.h" #include "access/relscan.h" #include "access/tsmapi.h" #include "catalog/pg_type.h" diff --git a/contrib/tsm_system_time/tsm_system_time.c b/contrib/tsm_system_time/tsm_system_time.c index 50c3db06428..f516552cc02 100644 --- a/contrib/tsm_system_time/tsm_system_time.c +++ b/contrib/tsm_system_time/tsm_system_time.c @@ -26,6 +26,7 @@ #include <math.h> +#include "access/heapam.h" #include "access/relscan.h" #include "access/tsmapi.h" #include "catalog/pg_type.h" |