summaryrefslogtreecommitdiff
path: root/src/include/access/relscan.h
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2008-06-19 00:46:06 +0000
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2008-06-19 00:46:06 +0000
commita3540b0f657c6352ae91884a9ee47c67395ce122 (patch)
treec0447efbf3f5a885f29d080e4005ff5562484513 /src/include/access/relscan.h
parentd1da215d325a1b8923def0a59cf2b948186164c8 (diff)
downloadpostgresql-a3540b0f657c6352ae91884a9ee47c67395ce122.tar.gz
Improve our #include situation by moving pointer types away from the
corresponding struct definitions. This allows other headers to avoid including certain highly-loaded headers such as rel.h and relscan.h, instead using just relcache.h, heapam.h or genam.h, which are more lightweight and thus cause less unnecessary dependencies.
Diffstat (limited to 'src/include/access/relscan.h')
-rw-r--r--src/include/access/relscan.h33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/include/access/relscan.h b/src/include/access/relscan.h
index b5ab8cff65..fe5cc31788 100644
--- a/src/include/access/relscan.h
+++ b/src/include/access/relscan.h
@@ -7,18 +7,15 @@
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/relscan.h,v 1.65 2008/05/12 00:00:53 alvherre Exp $
+ * $PostgreSQL: pgsql/src/include/access/relscan.h,v 1.66 2008/06/19 00:46:06 alvherre Exp $
*
*-------------------------------------------------------------------------
*/
#ifndef RELSCAN_H
#define RELSCAN_H
-#include "access/htup.h"
-#include "access/skey.h"
-#include "storage/bufpage.h"
-#include "utils/rel.h"
-#include "utils/snapshot.h"
+#include "access/genam.h"
+#include "access/heapam.h"
typedef struct HeapScanDescData
@@ -54,8 +51,6 @@ typedef struct HeapScanDescData
OffsetNumber rs_vistuples[MaxHeapTuplesPerPage]; /* their offsets */
} HeapScanDescData;
-typedef HeapScanDescData *HeapScanDesc;
-
/*
* We use the same IndexScanDescData structure for both amgettuple-based
* and amgetbitmap-based index scans. Some fields are only relevant in
@@ -89,19 +84,13 @@ typedef struct IndexScanDescData
TransactionId xs_prev_xmax; /* previous HOT chain member's XMAX, if any */
} IndexScanDescData;
-typedef IndexScanDescData *IndexScanDesc;
-
-
-/*
- * HeapScanIsValid
- * True iff the heap scan is valid.
- */
-#define HeapScanIsValid(scan) PointerIsValid(scan)
-
-/*
- * IndexScanIsValid
- * True iff the index scan is valid.
- */
-#define IndexScanIsValid(scan) PointerIsValid(scan)
+/* Struct for heap-or-index scans of system tables */
+typedef struct SysScanDescData
+{
+ Relation heap_rel; /* catalog being scanned */
+ Relation irel; /* NULL if doing heap scan */
+ HeapScanDesc scan; /* only valid in heap-scan case */
+ IndexScanDesc iscan; /* only valid in index-scan case */
+} SysScanDescData;
#endif /* RELSCAN_H */