]> granicus.if.org Git - postgresql/commit
Don't include heapam.h from others headers.
authorAndres Freund <andres@anarazel.de>
Mon, 14 Jan 2019 23:54:18 +0000 (15:54 -0800)
committerAndres Freund <andres@anarazel.de>
Tue, 15 Jan 2019 00:24:41 +0000 (16:24 -0800)
commit4c850ecec649c1b1538c741b89cf65d8f7d61853
tree616cd9ae1c2e1dd8e6d38de606e7133235964437
parent42e2a580713201645d7caa4b27713ac777432d8d
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
71 files changed:
contrib/amcheck/verify_nbtree.c
contrib/dblink/dblink.c
contrib/file_fdw/file_fdw.c
contrib/pageinspect/btreefuncs.c
contrib/pageinspect/heapfuncs.c
contrib/pageinspect/rawpage.c
contrib/pg_freespacemap/pg_freespacemap.c
contrib/pg_visibility/pg_visibility.c
contrib/pgrowlocks/pgrowlocks.c
contrib/pgstattuple/pgstatapprox.c
contrib/pgstattuple/pgstattuple.c
contrib/postgres_fdw/postgres_fdw.c
contrib/tsm_system_rows/tsm_system_rows.c
contrib/tsm_system_time/tsm_system_time.c
src/backend/access/brin/brin.c
src/backend/access/common/indextuple.c
src/backend/access/index/genam.c
src/backend/access/index/indexam.c
src/backend/access/nbtree/nbtsort.c
src/backend/access/tablesample/system.c
src/backend/bootstrap/bootstrap.c
src/backend/catalog/dependency.c
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/indexing.c
src/backend/catalog/objectaddress.c
src/backend/catalog/pg_proc.c
src/backend/catalog/toasting.c
src/backend/commands/alter.c
src/backend/commands/analyze.c
src/backend/commands/cluster.c
src/backend/commands/constraint.c
src/backend/commands/createas.c
src/backend/commands/event_trigger.c
src/backend/commands/extension.c
src/backend/commands/indexcmds.c
src/backend/commands/matview.c
src/backend/commands/sequence.c
src/backend/commands/statscmds.c
src/backend/commands/typecmds.c
src/backend/executor/execMain.c
src/backend/executor/execPartition.c
src/backend/executor/execReplication.c
src/backend/executor/execUtils.c
src/backend/executor/nodeBitmapHeapscan.c
src/backend/executor/nodeLockRows.c
src/backend/executor/nodeModifyTable.c
src/backend/executor/nodeSamplescan.c
src/backend/executor/nodeSeqscan.c
src/backend/executor/nodeTidscan.c
src/backend/optimizer/plan/planner.c
src/backend/parser/parse_relation.c
src/backend/parser/parse_utilcmd.c
src/backend/partitioning/partbounds.c
src/backend/replication/logical/tablesync.c
src/backend/replication/logical/worker.c
src/backend/rewrite/rewriteHandler.c
src/backend/utils/adt/misc.c
src/backend/utils/adt/ri_triggers.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/xml.c
src/backend/utils/cache/relcache.c
src/backend/utils/fmgr/funcapi.c
src/include/access/heapam.h
src/include/access/hio.h
src/include/access/relscan.h
src/include/catalog/index.h
src/include/executor/executor.h
src/include/nodes/execnodes.h
src/include/nodes/lockoptions.h