]> granicus.if.org Git - postgresql/commitdiff
Don't include genam.h from execnodes.h and relscan.h anymore.
authorAndres Freund <andres@anarazel.de>
Tue, 15 Jan 2019 01:02:12 +0000 (17:02 -0800)
committerAndres Freund <andres@anarazel.de>
Tue, 15 Jan 2019 01:02:12 +0000 (17:02 -0800)
This is the genam.h equivalent of 4c850ecec649c (which removed
heapam.h from a lot of other headers).  There's still a few header
includes of genam.h, but not from central headers anymore.

As a few headers are not indirectly included anymore, execnodes.h and
relscan.h need a few additional includes. Some of the depended on
types were replacable by using the underlying structs, but e.g. for
Snapshot in execnodes.h that'd have gotten more invasive than
reasonable in this commit.

Like the aforementioned commit 4c850ecec649c, this requires adding new
genam.h includes to a number of backend files, which likely is also
required in a few external projects.

Author: Andres Freund
Discussion: https://postgr.es/m/20190114000701.y4ttcb74jpskkcfb@alap3.anarazel.de

22 files changed:
src/backend/access/heap/heapam.c
src/backend/access/index/genam.c
src/backend/bootstrap/bootstrap.c
src/backend/catalog/dependency.c
src/backend/catalog/heap.c
src/backend/catalog/indexing.c
src/backend/catalog/objectaddress.c
src/backend/commands/analyze.c
src/backend/commands/constraint.c
src/backend/commands/extension.c
src/backend/commands/matview.c
src/backend/commands/typecmds.c
src/backend/executor/execCurrent.c
src/backend/executor/execIndexing.c
src/backend/executor/execReplication.c
src/backend/executor/nodeBitmapIndexscan.c
src/backend/executor/nodeIndexonlyscan.c
src/backend/optimizer/plan/planner.c
src/backend/utils/init/postinit.c
src/include/access/relscan.h
src/include/executor/nodeIndexscan.h
src/include/nodes/execnodes.h

index 2c4a1453576890f46b31a8db6bd2c12743d49ec5..3a184f2eccbe7b0dd73eb84106dd91efc3e0dc5e 100644 (file)
@@ -39,6 +39,7 @@
 #include "postgres.h"
 
 #include "access/bufmask.h"
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "access/heapam_xlog.h"
 #include "access/hio.h"
index e632ad0a9bc9212294d1db170414fb9634c7b25f..ffd79ffca7d13dd24a05cb76b0069a7599846f0c 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "access/relscan.h"
 #include "access/transam.h"
index 776533a2efbcce024ca2dde30fd2d51c6fb646bc..63bb134949682af1818846bf5a9ed68f8e35cca3 100644 (file)
@@ -17,6 +17,7 @@
 #include <unistd.h>
 #include <signal.h>
 
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "access/htup_details.h"
 #include "access/xact.h"
index f5560e6f7064a20551d6ea8acfb4eb1af887523f..35290847bd9f5950c44c67b5d009a4c6a1a0b524 100644 (file)
@@ -14,6 +14,7 @@
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/htup_details.h"
 #include "access/heapam.h"
 #include "access/xact.h"
index 149d97e3c3b1fcaefc24bc7a9640c82acec2d118..d7ccf2bfbef6c5c4593e4a97f3999d12f382c847 100644 (file)
@@ -29,6 +29,7 @@
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "access/htup_details.h"
 #include "access/multixact.h"
index 954e3f9ab654d447b31b9a4a6e196e813bb06756..0c994122d858bcf4f82b4c15828cf70b060c81ba 100644 (file)
@@ -15,6 +15,7 @@
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "access/htup_details.h"
 #include "catalog/index.h"
index 66c2f54d5bf54eeef9ce6f218a3453392f45a81b..f9214f8b629e244981fdceed41af7ffd4c315d09 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "access/htup_details.h"
 #include "access/sysattr.h"
index 4248def61a7464d59752176eb2ba09c6455cfb9c..99e3f2a672ad6a46dbfc9fcb2c7e7bcd287254e2 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <math.h>
 
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "access/multixact.h"
 #include "access/sysattr.h"
index b9aec7d18be96108816afcf47c5fc4feb24c120b..66914007ecf9c78d23544af969183386b43595f2 100644 (file)
@@ -13,6 +13,7 @@
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "catalog/index.h"
 #include "commands/trigger.h"
index f63238454a34fbc9c2c14a26773e275ec07fd3f7..e381a30760143ce7af5c5ecde17eef560bb3b84b 100644 (file)
@@ -29,6 +29,7 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "access/htup_details.h"
 #include "access/sysattr.h"
index 846bd7608ceb810904adfb82525a753584a8b969..416051a8e30addbfe6988a463aff4f1c03d4f40d 100644 (file)
@@ -14,6 +14,7 @@
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "access/htup_details.h"
 #include "access/multixact.h"
index 769504c4591b87887ac726dd5a819d08054edd42..9ca30b0443ce1d479d6bfb16e2170c04e97f694a 100644 (file)
@@ -31,6 +31,7 @@
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "access/htup_details.h"
 #include "access/xact.h"
index 82dbf72675b15e56131eb82efd8f4e953a5946d4..fe99096efc2130fee4a9d0e09109e93ec5b2d3b1 100644 (file)
@@ -12,6 +12,7 @@
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/relscan.h"
 #include "access/sysattr.h"
 #include "catalog/pg_type.h"
index c5b453ddcbef9b68d17c92c89fe7fa45f9910149..92ca129858c8ca569462ad1069471499a0dfcb64 100644 (file)
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/relscan.h"
 #include "access/xact.h"
 #include "catalog/index.h"
index f7602f25553ec0b8283026eac7ac91813d6cdb4d..6ffe921f28f2db12a944c4e7a54bf9dfcd860c91 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "access/relscan.h"
 #include "access/transam.h"
index 2526c3a2fc088933990d2a52b40e2b3e7f084ef3..bd837d3cd8e13c5a146461e6553afc02697faf21 100644 (file)
@@ -21,6 +21,7 @@
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "executor/execdebug.h"
 #include "executor/nodeBitmapIndexscan.h"
 #include "executor/nodeIndexscan.h"
index c96a2c3ae9dd7b02a6b4ebe6dc950784d2445d99..b3f61dd1fc63417d476e2aebe82b2c3921e343eb 100644 (file)
@@ -30,7 +30,9 @@
  */
 #include "postgres.h"
 
+#include "access/genam.h"
 #include "access/relscan.h"
+#include "access/tupdesc.h"
 #include "access/visibilitymap.h"
 #include "executor/execdebug.h"
 #include "executor/nodeIndexonlyscan.h"
index 8cdcf2368b2bc6d9d1cd4c72a124fc1046ae0572..5ba612922f95968f5c995fa874611a14e7af08c9 100644 (file)
@@ -18,6 +18,7 @@
 #include <limits.h>
 #include <math.h>
 
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "access/htup_details.h"
 #include "access/parallel.h"
index c3373dfaf3d078fa9db5a533955d4e1a0d9767a7..7415c4faabc8d6cc3147d37884ab5ff25b98b836 100644 (file)
@@ -19,6 +19,7 @@
 #include <fcntl.h>
 #include <unistd.h>
 
+#include "access/genam.h"
 #include "access/heapam.h"
 #include "access/htup_details.h"
 #include "access/session.h"
index 43a2286c17272286245ab7529e87bc24a8df69df..b78ef2f47d07c03aa6e143e6e2cb067374984f29 100644 (file)
 #ifndef RELSCAN_H
 #define RELSCAN_H
 
-#include "access/genam.h"
 #include "access/htup_details.h"
 #include "access/itup.h"
-#include "access/tupdesc.h"
+#include "port/atomics.h"
+#include "storage/buf.h"
 #include "storage/spin.h"
+#include "utils/relcache.h"
 
 /*
  * Shared state for parallel heap scan.
@@ -46,9 +47,9 @@ typedef struct HeapScanDescData
 {
        /* scan parameters */
        Relation        rs_rd;                  /* heap relation descriptor */
-       Snapshot        rs_snapshot;    /* snapshot to see */
+       struct SnapshotData *rs_snapshot;       /* snapshot to see */
        int                     rs_nkeys;               /* number of scan keys */
-       ScanKey         rs_key;                 /* array of scan key descriptors */
+       struct ScanKeyData *rs_key;                     /* array of scan key descriptors */
        bool            rs_bitmapscan;  /* true if this is really a bitmap scan */
        bool            rs_samplescan;  /* true if this is really a sample scan */
        bool            rs_pageatatime; /* verify visibility page-at-a-time? */
@@ -88,11 +89,11 @@ typedef struct IndexScanDescData
        /* scan parameters */
        Relation        heapRelation;   /* heap relation descriptor, or NULL */
        Relation        indexRelation;  /* index relation descriptor */
-       Snapshot        xs_snapshot;    /* snapshot to see */
+       struct SnapshotData *xs_snapshot;       /* snapshot to see */
        int                     numberOfKeys;   /* number of index qualifier conditions */
        int                     numberOfOrderBys;       /* number of ordering operators */
-       ScanKey         keyData;                /* array of index qualifier descriptors */
-       ScanKey         orderByData;    /* array of ordering op descriptors */
+       struct ScanKeyData *keyData;            /* array of index qualifier descriptors */
+       struct ScanKeyData *orderByData;        /* array of ordering op descriptors */
        bool            xs_want_itup;   /* caller requests index tuples */
        bool            xs_temp_snap;   /* unregister snapshot at scan end? */
 
@@ -112,9 +113,9 @@ typedef struct IndexScanDescData
         * format will be used.
         */
        IndexTuple      xs_itup;                /* index tuple returned by AM */
-       TupleDesc       xs_itupdesc;    /* rowtype descriptor of xs_itup */
+       struct TupleDescData *xs_itupdesc;      /* rowtype descriptor of xs_itup */
        HeapTuple       xs_hitup;               /* index data returned by AM, as HeapTuple */
-       TupleDesc       xs_hitupdesc;   /* rowtype descriptor of xs_hitup */
+       struct TupleDescData *xs_hitupdesc;     /* rowtype descriptor of xs_hitup */
 
        /* xs_ctup/xs_cbuf/xs_recheck are valid after a successful index_getnext */
        HeapTupleData xs_ctup;          /* current heap tuple, if any */
@@ -137,7 +138,7 @@ typedef struct IndexScanDescData
        bool            xs_continue_hot;        /* T if must keep walking HOT chain */
 
        /* parallel index scan information, in shared memory */
-       ParallelIndexScanDesc parallel_scan;
+       struct ParallelIndexScanDescData *parallel_scan;
 }                      IndexScanDescData;
 
 /* Generic structure for parallel scans */
@@ -155,8 +156,8 @@ typedef struct SysScanDescData
        Relation        heap_rel;               /* catalog being scanned */
        Relation        irel;                   /* NULL if doing heap scan */
        struct HeapScanDescData *scan;                  /* only valid in heap-scan case */
-       IndexScanDesc iscan;            /* only valid in index-scan case */
-       Snapshot        snapshot;               /* snapshot to unregister at end of scan */
+       struct IndexScanDescData *iscan;                /* only valid in index-scan case */
+       struct SnapshotData *snapshot;          /* snapshot to unregister at end of scan */
 }                      SysScanDescData;
 
 #endif                                                 /* RELSCAN_H */
index 028cdb61d1c0c8e0e79cc76b03c8661a137a722e..9f660499f32c201647a5e3e5d2ce3caff57777e9 100644 (file)
@@ -14,6 +14,7 @@
 #ifndef NODEINDEXSCAN_H
 #define NODEINDEXSCAN_H
 
+#include "access/genam.h"
 #include "access/parallel.h"
 #include "nodes/execnodes.h"
 
index 57031654900fabf66cd6be15736b0f5d2733e397..7cae0851774be733d23b8ca3bbd1e666d50e3c3a 100644 (file)
@@ -14,7 +14,6 @@
 #ifndef EXECNODES_H
 #define EXECNODES_H
 
-#include "access/genam.h"
 #include "access/tupconvert.h"
 #include "executor/instrument.h"
 #include "lib/pairingheap.h"
@@ -24,6 +23,7 @@
 #include "utils/queryenvironment.h"
 #include "utils/reltrigger.h"
 #include "utils/sharedtuplestore.h"
+#include "utils/snapshot.h"
 #include "utils/sortsupport.h"
 #include "utils/tuplestore.h"
 #include "utils/tuplesort.h"
@@ -1306,14 +1306,14 @@ typedef struct SampleScanState
  */
 typedef struct
 {
-       ScanKey         scan_key;               /* scankey to put value into */
+       struct ScanKeyData *scan_key;           /* scankey to put value into */
        ExprState  *key_expr;           /* expr to evaluate to get value */
        bool            key_toastable;  /* is expr's result a toastable datatype? */
 } IndexRuntimeKeyInfo;
 
 typedef struct
 {
-       ScanKey         scan_key;               /* scankey to put value into */
+       struct ScanKeyData *scan_key;           /* scankey to put value into */
        ExprState  *array_expr;         /* expr to evaluate to get array value */
        int                     next_elem;              /* next array element to use */
        int                     num_elems;              /* number of elems in current array value */
@@ -1352,16 +1352,16 @@ typedef struct IndexScanState
        ScanState       ss;                             /* its first field is NodeTag */
        ExprState  *indexqualorig;
        List       *indexorderbyorig;
-       ScanKey         iss_ScanKeys;
+       struct ScanKeyData *iss_ScanKeys;
        int                     iss_NumScanKeys;
-       ScanKey         iss_OrderByKeys;
+       struct ScanKeyData *iss_OrderByKeys;
        int                     iss_NumOrderByKeys;
        IndexRuntimeKeyInfo *iss_RuntimeKeys;
        int                     iss_NumRuntimeKeys;
        bool            iss_RuntimeKeysReady;
        ExprContext *iss_RuntimeContext;
        Relation        iss_RelationDesc;
-       IndexScanDesc iss_ScanDesc;
+       struct IndexScanDescData *iss_ScanDesc;
 
        /* These are needed for re-checking ORDER BY expr ordering */
        pairingheap *iss_ReorderQueue;
@@ -1397,16 +1397,16 @@ typedef struct IndexOnlyScanState
 {
        ScanState       ss;                             /* its first field is NodeTag */
        ExprState  *indexqual;
-       ScanKey         ioss_ScanKeys;
+       struct ScanKeyData *ioss_ScanKeys;
        int                     ioss_NumScanKeys;
-       ScanKey         ioss_OrderByKeys;
+       struct ScanKeyData *ioss_OrderByKeys;
        int                     ioss_NumOrderByKeys;
        IndexRuntimeKeyInfo *ioss_RuntimeKeys;
        int                     ioss_NumRuntimeKeys;
        bool            ioss_RuntimeKeysReady;
        ExprContext *ioss_RuntimeContext;
        Relation        ioss_RelationDesc;
-       IndexScanDesc ioss_ScanDesc;
+       struct IndexScanDescData *ioss_ScanDesc;
        Buffer          ioss_VMBuffer;
        Size            ioss_PscanLen;
 } IndexOnlyScanState;
@@ -1431,7 +1431,7 @@ typedef struct BitmapIndexScanState
 {
        ScanState       ss;                             /* its first field is NodeTag */
        TIDBitmap  *biss_result;
-       ScanKey         biss_ScanKeys;
+       struct ScanKeyData *biss_ScanKeys;
        int                     biss_NumScanKeys;
        IndexRuntimeKeyInfo *biss_RuntimeKeys;
        int                     biss_NumRuntimeKeys;
@@ -1440,7 +1440,7 @@ typedef struct BitmapIndexScanState
        bool            biss_RuntimeKeysReady;
        ExprContext *biss_RuntimeContext;
        Relation        biss_RelationDesc;
-       IndexScanDesc biss_ScanDesc;
+       struct IndexScanDescData *biss_ScanDesc;
 } BitmapIndexScanState;
 
 /* ----------------