Restructure some header files a bit, in particular heapam.h, by removing some
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 12 May 2008 00:00:54 +0000 (00:00 +0000)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Mon, 12 May 2008 00:00:54 +0000 (00:00 +0000)
unnecessary #include lines in it.  Also, move some tuple routine prototypes and
macros to htup.h, which allows removal of heapam.h inclusion from some .c
files.

For this to work, a new header file access/sysattr.h needed to be created,
initially containing attribute numbers of system columns, for pg_dump usage.

While at it, make contrib ltree, intarray and hstore header files more
consistent with our header style.

153 files changed:
contrib/hstore/hstore.h
contrib/hstore/hstore_gin.c
contrib/hstore/hstore_gist.c
contrib/hstore/hstore_io.c
contrib/hstore/hstore_op.c
contrib/intagg/int_aggregate.c
contrib/intarray/_int.h
contrib/intarray/_int_bool.c
contrib/intarray/_int_gin.c
contrib/intarray/_int_gist.c
contrib/intarray/_int_op.c
contrib/intarray/_int_tool.c
contrib/intarray/_intbig_gist.c
contrib/ltree/_ltree_gist.c
contrib/ltree/_ltree_op.c
contrib/ltree/lquery_op.c
contrib/ltree/ltree.h
contrib/ltree/ltree_gist.c
contrib/ltree/ltree_io.c
contrib/ltree/ltree_op.c
contrib/ltree/ltxtquery_io.c
contrib/ltree/ltxtquery_op.c
contrib/pageinspect/btreefuncs.c
contrib/pageinspect/rawpage.c
contrib/pg_freespacemap/pg_freespacemap.c
contrib/pgrowlocks/pgrowlocks.c
contrib/pgstattuple/pgstatindex.c
contrib/pgstattuple/pgstattuple.c
src/backend/access/common/heaptuple.c
src/backend/access/gin/ginbtree.c
src/backend/access/gin/gindatapage.c
src/backend/access/gin/ginentrypage.c
src/backend/access/gin/ginget.c
src/backend/access/gin/gininsert.c
src/backend/access/gin/ginscan.c
src/backend/access/gin/ginutil.c
src/backend/access/gin/ginvacuum.c
src/backend/access/gin/ginxlog.c
src/backend/access/gist/gist.c
src/backend/access/gist/gistget.c
src/backend/access/gist/gistscan.c
src/backend/access/gist/gistutil.c
src/backend/access/gist/gistvacuum.c
src/backend/access/gist/gistxlog.c
src/backend/access/hash/hash.c
src/backend/access/hash/hashinsert.c
src/backend/access/hash/hashovfl.c
src/backend/access/hash/hashpage.c
src/backend/access/hash/hashsearch.c
src/backend/access/hash/hashutil.c
src/backend/access/heap/heapam.c
src/backend/access/heap/hio.c
src/backend/access/heap/pruneheap.c
src/backend/access/heap/rewriteheap.c
src/backend/access/heap/syncscan.c
src/backend/access/index/indexam.c
src/backend/access/nbtree/nbtinsert.c
src/backend/access/nbtree/nbtpage.c
src/backend/access/nbtree/nbtree.c
src/backend/access/nbtree/nbtsearch.c
src/backend/access/nbtree/nbtutils.c
src/backend/access/nbtree/nbtxlog.c
src/backend/access/transam/twophase.c
src/backend/access/transam/xact.c
src/backend/access/transam/xlog.c
src/backend/access/transam/xlogutils.c
src/backend/bootstrap/bootstrap.c
src/backend/catalog/aclchk.c
src/backend/catalog/catalog.c
src/backend/catalog/dependency.c
src/backend/catalog/heap.c
src/backend/catalog/index.c
src/backend/catalog/pg_conversion.c
src/backend/catalog/pg_shdepend.c
src/backend/commands/analyze.c
src/backend/commands/cluster.c
src/backend/commands/dbcommands.c
src/backend/commands/functioncmds.c
src/backend/commands/indexcmds.c
src/backend/commands/opclasscmds.c
src/backend/commands/prepare.c
src/backend/commands/sequence.c
src/backend/commands/tablecmds.c
src/backend/commands/tablespace.c
src/backend/commands/trigger.c
src/backend/commands/user.c
src/backend/commands/vacuum.c
src/backend/commands/vacuumlazy.c
src/backend/executor/execCurrent.c
src/backend/executor/execMain.c
src/backend/executor/execQual.c
src/backend/executor/execTuples.c
src/backend/executor/nodeAgg.c
src/backend/executor/nodeBitmapHeapscan.c
src/backend/executor/nodeSubplan.c
src/backend/executor/nodeTidscan.c
src/backend/executor/spi.c
src/backend/optimizer/path/tidpath.c
src/backend/optimizer/prep/preptlist.c
src/backend/optimizer/util/clauses.c
src/backend/optimizer/util/plancat.c
src/backend/optimizer/util/var.c
src/backend/parser/parse_relation.c
src/backend/postmaster/autovacuum.c
src/backend/postmaster/bgwriter.c
src/backend/rewrite/rewriteRemove.c
src/backend/storage/buffer/bufmgr.c
src/backend/storage/ipc/ipci.c
src/backend/tcop/postgres.c
src/backend/tsearch/wparser.c
src/backend/utils/adt/arrayfuncs.c
src/backend/utils/adt/datetime.c
src/backend/utils/adt/genfile.c
src/backend/utils/adt/lockfuncs.c
src/backend/utils/adt/pgstatfuncs.c
src/backend/utils/adt/rowtypes.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/tid.c
src/backend/utils/adt/varlena.c
src/backend/utils/adt/xml.c
src/backend/utils/cache/catcache.c
src/backend/utils/cache/relcache.c
src/backend/utils/cache/syscache.c
src/backend/utils/fmgr/fmgr.c
src/backend/utils/init/flatfiles.c
src/backend/utils/init/postinit.c
src/backend/utils/misc/guc.c
src/backend/utils/mmgr/portalmem.c
src/backend/utils/resowner/resowner.c
src/backend/utils/sort/tuplesort.c
src/backend/utils/sort/tuplestore.c
src/bin/pg_dump/pg_dump.c
src/include/access/genam.h
src/include/access/gin.h
src/include/access/gist.h
src/include/access/gistscan.h
src/include/access/heapam.h
src/include/access/htup.h
src/include/access/relscan.h
src/include/access/sysattr.h [new file with mode: 0644]
src/include/access/tuptoaster.h
src/include/parser/parser.h
src/include/rewrite/rewriteDefine.h
src/include/storage/bufpage.h
src/include/storage/lmgr.h
src/include/storage/lock.h
src/include/utils/tuplesort.h
src/pl/plpgsql/src/pl_comp.c
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/pl_handler.c
src/pl/plpython/plpython.c
src/pl/tcl/pltcl.c

index 48ec6e064880bd3fd0a950782b05c181280a8059..84c3f41109af3fe8c028771e55eecacc3e6116c3 100644 (file)
@@ -1,15 +1,10 @@
+/*
+ * $PostgreSQL$
+ */
 #ifndef __HSTORE_H__
 #define __HSTORE_H__
 
-#include "postgres.h"
-
-#include "funcapi.h"
-#include "access/gist.h"
-#include "access/itup.h"
-#include "utils/elog.h"
-#include "utils/palloc.h"
-#include "utils/builtins.h"
-#include "storage/bufpage.h"
+#include "fmgr.h"
 
 
 typedef struct
@@ -53,4 +48,4 @@ int                   uniquePairs(Pairs * a, int4 l, int4 *buflen);
 #define HStoreContainsStrategyNumber   7
 #define HStoreExistsStrategyNumber             9
 
-#endif
+#endif /* __HSTORE_H__ */
index aec25b2b652a2ed59de1f1cd8e19eed5509fb379..a4be8059b95fbed8c7a5615c43fda525af54762b 100644 (file)
@@ -1,7 +1,13 @@
-#include "hstore.h"
+/*
+ * $PostgreSQL$
+ */
+#include "postgres.h"
 
 #include "access/gin.h"
 
+#include "hstore.h"
+
+
 #define KEYFLAG                'K'
 #define VALFLAG                'V'
 #define NULLFLAG       'N'
index 15ac9659919a16a56001b2387225678cfc9656da..dc9405cb1018c7cda43f93357677ab7670e43cd3 100644 (file)
@@ -1,9 +1,15 @@
-#include "hstore.h"
+/*
+ * $PostgreSQL$
+ */
+#include "postgres.h"
 
 #include "access/gist.h"
 #include "access/itup.h"
+#include "access/skey.h"
 #include "crc32.h"
 
+#include "hstore.h"
+
 /* bigint defines */
 #define BITBYTE 8
 #define SIGLENINT  4                   /* >122 => key will toast, so very slow!!! */
index 6a395a2b867767c8ba96c5cc8d7eaa3bc8b0b52c..faf24d97c62d2d413c20a4d3dc2f8d916c438038 100644 (file)
@@ -1,6 +1,12 @@
-#include "hstore.h"
+/*
+ * $PostgreSQL$
+ */
+#include "postgres.h"
+
 #include <ctype.h>
 
+#include "hstore.h"
+
 PG_MODULE_MAGIC;
 
 typedef struct
index 961abfe35c968a110527352b58f1d341e11e8e30..4f285ee633953d3ab5c13d2a26856183112912fa 100644 (file)
@@ -1,9 +1,14 @@
-#include "hstore.h"
-#include "utils/array.h"
+/*
+ * $PostgreSQL
+ */
+#include "postgres.h"
+
 #include "catalog/pg_type.h"
 #include "funcapi.h"
-#include <access/heapam.h>
-#include <fmgr.h>
+#include "utils/array.h"
+#include "utils/builtins.h"
+
+#include "hstore.h"
 
 
 static HEntry *
index b32f6745995504fc1f847dbb0f8f7721001221ab..6f85eac0dca86b673e2d080767ccd66165805d62 100644 (file)
@@ -19,8 +19,6 @@
 #include <ctype.h>
 #include <sys/types.h>
 
-#include "access/heapam.h"
-#include "access/tupmacs.h"
 #include "access/xact.h"
 #include "catalog/indexing.h"
 #include "catalog/pg_proc.h"
index 0a1888da3b151639bf388719092749f1abc03c4e..6a9bccb525addcb6277d76b175fcaa3e49570714 100644 (file)
@@ -1,18 +1,7 @@
 #ifndef ___INT_H__
 #define ___INT_H__
 
-#include "postgres.h"
-
-#include <float.h>
-
-#include "access/gist.h"
-#include "access/itup.h"
-#include "access/skey.h"
-#include "catalog/pg_type.h"
 #include "utils/array.h"
-#include "utils/builtins.h"
-#include "storage/bufpage.h"
-#include "lib/stringinfo.h"
 
 /* number ranges for compression */
 #define MAXNUMRANGE 100
@@ -173,4 +162,4 @@ if (ARRNELEMS(a) > 1)                                                                                       \
                qsort((void*)ARRPTR(a), ARRNELEMS(a),sizeof(int4),              \
                                (direction) ? compASC : compDESC )
 
-#endif
+#endif /* ___INT_H__ */
index ef9430901dc48718ecd35c5acad7452d5fcf3c6d..a9fc66c1ffea3adaa077b5d01266af820d30347f 100644 (file)
@@ -1,3 +1,7 @@
+#include "postgres.h"
+
+#include "utils/builtins.h"
+
 #include "_int.h"
 
 PG_FUNCTION_INFO_V1(bqarr_in);
index 8b6e99edae3b3cce332980ce40221febf9e0f0b9..d895990318129982426cad5242987dd7ad720eb6 100644 (file)
@@ -1,3 +1,8 @@
+#include "postgres.h"
+
+#include "access/gist.h"
+#include "access/skey.h"
+
 #include "_int.h"
 
 PG_FUNCTION_INFO_V1(ginint4_queryextract);
index 37c05784b96700ab5f4da2d677b1130f6ee1a62b..8f8f79a8245158113e96ffd47d423a9f56b96da3 100644 (file)
@@ -1,3 +1,8 @@
+#include "postgres.h"
+
+#include "access/gist.h"
+#include "access/skey.h"
+
 #include "_int.h"
 
 #define GETENTRY(vec,pos) ((ArrayType *) DatumGetPointer((vec)->vector[(pos)].key))
index 40650b6af8808ab23d1b3b137c8c875cd5a183d4..dd3b02892967f2fe72ff4908748f4ecf502afebf 100644 (file)
@@ -1,7 +1,10 @@
-#include "_int.h"
+#include "postgres.h"
 
 #include "lib/stringinfo.h"
 
+#include "_int.h"
+
+
 PG_MODULE_MAGIC;
 
 PG_FUNCTION_INFO_V1(_int_different);
index fead4ff30dcea82195823fa2c7ded8ed5521a64f..82ab490784df1fcf729936f7ee355fb66d8915f2 100644 (file)
@@ -1,3 +1,7 @@
+#include "postgres.h"
+
+#include "catalog/pg_type.h"
+
 #include "_int.h"
 
 
index b96c6d728937b153770bef0508790d78dea9b200..fe83860cfae3f9f4ccba03366b4cb1361e0ea8e8 100644 (file)
@@ -1,3 +1,8 @@
+#include "postgres.h"
+
+#include "access/gist.h"
+#include "access/skey.h"
+
 #include "_int.h"
 
 #define GETENTRY(vec,pos) ((GISTTYPE *) DatumGetPointer((vec)->vector[(pos)].key))
index 1c9b6b03eaa4d1e5c599ac5418c7ea361f835e1f..f1fa0fbaf421f044a861a9b8c72403ed9f5a98c7 100644 (file)
@@ -2,13 +2,14 @@
  * GiST support for ltree[]
  * Teodor Sigaev <teodor@stack.net>
  */
+#include "postgres.h"
 
-#include "ltree.h"
 #include "access/gist.h"
 #include "access/skey.h"
 #include "utils/array.h"
-
 #include "crc32.h"
+#include "ltree.h"
+
 
 PG_FUNCTION_INFO_V1(_ltree_compress);
 Datum          _ltree_compress(PG_FUNCTION_ARGS);
index f93d2bb8889574dc54efec1cdb2eee8cf5418a1c..4a648ee03e960c159bc025b01e92a77fdc668cc3 100644 (file)
@@ -2,10 +2,12 @@
  * op function for ltree[]
  * Teodor Sigaev <teodor@stack.net>
  */
+#include "postgres.h"
 
-#include "ltree.h"
 #include <ctype.h>
+
 #include "utils/array.h"
+#include "ltree.h"
 
 PG_FUNCTION_INFO_V1(_ltree_isparent);
 PG_FUNCTION_INFO_V1(_ltree_r_isparent);
index 3bc65208167f41b2ec587b018da3b5b13eeebf37..51d372cdba9904fa685c3ce4121223c460b7c4f3 100644 (file)
@@ -3,10 +3,12 @@
  * Teodor Sigaev <teodor@stack.net>
  * $PostgreSQL$
  */
+#include "postgres.h"
 
-#include "ltree.h"
 #include <ctype.h>
+
 #include "utils/array.h"
+#include "ltree.h"
 
 PG_FUNCTION_INFO_V1(ltq_regex);
 PG_FUNCTION_INFO_V1(ltq_rregex);
index 6117644222bf73a81addf69248ddc84ef74e9d87..8d39c9ec39aae89225d4fbc6cda9ad3ca41107e7 100644 (file)
@@ -3,9 +3,7 @@
 #ifndef __LTREE_H__
 #define __LTREE_H__
 
-#include "postgres.h"
-
-#include "utils/builtins.h"
+#include "fmgr.h"
 
 typedef struct
 {
index 72ce30818fb6f55ee47327839474ee836f916389..9c9e997741ae2b71e69a8d2fd19a716319444bc7 100644 (file)
@@ -3,13 +3,14 @@
  * Teodor Sigaev <teodor@stack.net>
  * $PostgreSQL$
  */
+#include "postgres.h"
 
-#include "ltree.h"
 #include "access/gist.h"
 #include "access/nbtree.h"
 #include "access/skey.h"
 #include "utils/array.h"
 #include "crc32.h"
+#include "ltree.h"
 
 #define NEXTVAL(x) ( (lquery*)( (char*)(x) + INTALIGN( VARSIZE(x) ) ) )
 
index d534a89690c69ca26a8dd25e1ad685c5b36798db..bd5010548753589d3dd31ee69f37a77354dab376 100644 (file)
@@ -3,9 +3,11 @@
  * Teodor Sigaev <teodor@stack.net>
  * $PostgreSQL$
  */
+#include "postgres.h"
 
-#include "ltree.h"
 #include <ctype.h>
+
+#include "ltree.h"
 #include "crc32.h"
 
 PG_FUNCTION_INFO_V1(ltree_in);
index 84b86189e4dd489bd1589f018f6d5b3790f308cf..af37070067d9b08ea2a5a8b1f836c6ac6e73d02d 100644 (file)
@@ -3,15 +3,16 @@
  * Teodor Sigaev <teodor@stack.net>
  * $PostgreSQL$
  */
-
-#include "ltree.h"
+#include "postgres.h"
 
 #include <ctype.h>
 
 #include "catalog/pg_statistic.h"
+#include "utils/builtins.h"
 #include "utils/lsyscache.h"
 #include "utils/selfuncs.h"
 #include "utils/syscache.h"
+#include "ltree.h"
 
 PG_MODULE_MAGIC;
 
index c67ca52c701a39d7fe536e0a8df619f3f7b78bc1..340370810bef35835dee1440477f95285d8ab766 100644 (file)
@@ -3,10 +3,12 @@
  * Teodor Sigaev <teodor@stack.net>
  * $PostgreSQL$
  */
+#include "postgres.h"
 
-#include "ltree.h"
 #include <ctype.h>
+
 #include "crc32.h"
+#include "ltree.h"
 
 PG_FUNCTION_INFO_V1(ltxtq_in);
 Datum          ltxtq_in(PG_FUNCTION_ARGS);
index 4e3b92a53bbca474c6c354a83375d61df3b0521f..3e73005e1282742db411bc8fdd82deaab2fa8210 100644 (file)
@@ -3,10 +3,12 @@
  * Teodor Sigaev <teodor@stack.net>
  * $PostgreSQL$
  */
+#include "postgres.h"
 
-#include "ltree.h"
 #include <ctype.h>
 
+#include "ltree.h"
+
 PG_FUNCTION_INFO_V1(ltxtq_exec);
 PG_FUNCTION_INFO_V1(ltxtq_rexec);
 
index ce8b97e46baadd6888c975ba8808fa99e98dfd48..3fbfb9c12b82d4625bce2a84156413fe498fe133 100644 (file)
@@ -30,6 +30,7 @@
 #include "catalog/pg_type.h"
 #include "funcapi.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "utils/builtins.h"
 
 
index 0ad83661f3f0451cbc14fad60e9860ca34255447..a616b57b4b0cfa67c86a8f4bfcb206955c62212b 100644 (file)
 
 #include "postgres.h"
 
-#include "fmgr.h"
-#include "funcapi.h"
 #include "access/heapam.h"
 #include "access/transam.h"
 #include "catalog/namespace.h"
 #include "catalog/pg_type.h"
-#include "utils/builtins.h"
+#include "fmgr.h"
+#include "funcapi.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
+#include "utils/builtins.h"
 
 PG_MODULE_MAGIC;
 
index f17ffbaf206c13ebafe5148986587e37d231d3af..bebea97da41bcc68445141026befef40389ad41e 100644 (file)
@@ -8,10 +8,11 @@
  */
 #include "postgres.h"
 
-#include "funcapi.h"
-#include "access/heapam.h"
+#include "access/htup.h"
 #include "catalog/pg_type.h"
+#include "funcapi.h"
 #include "storage/freespace.h"
+#include "storage/lmgr.h"
 
 
 #define                NUM_FREESPACE_PAGES_ELEM        5
index b2279be2098404c007046362115326cda532012d..5633c2469315d5b03c287dbf78edfb3f22723739 100644 (file)
@@ -30,6 +30,7 @@
 #include "catalog/namespace.h"
 #include "funcapi.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "storage/procarray.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
index 08200fafaebd7e2c4ef9120632bd7709f1392791..7b95a070b42d94041e12f1f2990ae7446a1ce035 100644 (file)
@@ -29,6 +29,7 @@
 #include "catalog/namespace.h"
 #include "funcapi.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "utils/builtins.h"
 
 
index addcda352e8da08e756ab5036654a78516bd8756..31dbd3027739e4074566b076967c70a1f9b5493c 100644 (file)
 #include "access/gist_private.h"
 #include "access/hash.h"
 #include "access/heapam.h"
+#include "access/htup.h"
 #include "access/nbtree.h"
 #include "catalog/namespace.h"
 #include "funcapi.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "utils/builtins.h"
 #include "utils/tqual.h"
 
index f156a64d3d0a5c2cb7976b5654344a2300689019..f27ce02e6e2d771f1bb34e4a93b716a9a9748cfc 100644 (file)
@@ -65,6 +65,7 @@
 #include "postgres.h"
 
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "access/tuptoaster.h"
 #include "executor/tuptable.h"
 
index cb2bdef3b4d09878c8683b6173aea0d1d9825849..910f9b6a759776fb29804401ea9cad0518bd4d15 100644 (file)
  */
 
 #include "postgres.h"
+
 #include "access/gin.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 
 /*
  * Locks buffer by needed method for search.
index f7f683ac309efa863c0cff634d6b4d25918783a8..38316331e6b33ee387be39a006477a2ed36e83d3 100644 (file)
@@ -13,7 +13,9 @@
  */
 
 #include "postgres.h"
+
 #include "access/gin.h"
+#include "storage/bufmgr.h"
 
 int
 compareItemPointers(ItemPointer a, ItemPointer b)
index 8630a6881a2d92b7d162c794bee5078ec0894371..861b4c138aaf87e5e21675dd3ab977c24282cf7c 100644 (file)
@@ -15,6 +15,7 @@
 #include "postgres.h"
 #include "access/gin.h"
 #include "access/tuptoaster.h"
+#include "storage/bufmgr.h"
 
 /*
  * forms tuple for entry tree. On leaf page, Index tuple has
index aa51b9f052c6ee08c03a3307798fa592cea9e2e9..4f54157bca29c2878e180606bf8783c0f0288840 100644 (file)
@@ -17,6 +17,7 @@
 #include "access/gin.h"
 #include "catalog/index.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "utils/memutils.h"
 
 static bool
index 4bbf3f04988dd60af2a882d36b68e40afc26afef..6fa07caf5aee72e63cb04b50053d59b83071cfa2 100644 (file)
@@ -18,6 +18,7 @@
 #include "access/gin.h"
 #include "catalog/index.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "utils/memutils.h"
 
 
index 5f28db592616c810a764bfdce08290035f37c52a..f43a52e4fe16b52fe1310deb26b44aeefd3dd4a1 100644 (file)
  */
 
 #include "postgres.h"
+
 #include "access/genam.h"
 #include "access/gin.h"
 #include "pgstat.h"
+#include "storage/bufmgr.h"
 #include "utils/memutils.h"
 
 
index 3443b51de6a818951761019c9b8f64231904a028..3b3426bd29831d2f0ff29214a5876ae5a38ba06b 100644 (file)
 #include "postgres.h"
 #include "access/genam.h"
 #include "access/gin.h"
-#include "access/heapam.h"
 #include "access/reloptions.h"
+#include "storage/bufmgr.h"
 #include "storage/freespace.h"
+#include "storage/lmgr.h"
 
 void
 initGinState(GinState *state, Relation index)
index e0bbe32963527c50f97ca7f9376528dfa63b5078..fbd2b45c0547f343f63782d4a3addf9df0f6a784 100644 (file)
  */
 
 #include "postgres.h"
+
 #include "access/genam.h"
 #include "access/gin.h"
-#include "access/heapam.h"
+#include "commands/vacuum.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "storage/freespace.h"
-#include "storage/freespace.h"
-#include "commands/vacuum.h"
+#include "storage/lmgr.h"
 
 typedef struct
 {
index 4f631fb57bca78415d642a338511d248da27004f..d3dd8d69b179f9f1066be16a9b29be65c90836ad 100644 (file)
@@ -14,7 +14,8 @@
 #include "postgres.h"
 
 #include "access/gin.h"
-#include "access/heapam.h"
+#include "access/xlogutils.h"
+#include "storage/bufmgr.h"
 #include "utils/memutils.h"
 
 static MemoryContext opCtx;            /* working memory for operations */
index 615bd8fd3532057597c6ff93f7352ba67a00c8bb..77ff12ddcf4e8f9660fbbf80ecc99a339d244205 100644 (file)
@@ -18,6 +18,7 @@
 #include "access/gist_private.h"
 #include "catalog/index.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "utils/memutils.h"
 
 const XLogRecPtr XLogRecPtrForTemp = {1, 1};
index df0e80e4f764a5a4e561f47a4b1d2c5fa51866fb..5ace610311b7ee877d711218545ae847439c0e2c 100644 (file)
@@ -18,6 +18,7 @@
 #include "executor/execdebug.h"
 #include "miscadmin.h"
 #include "pgstat.h"
+#include "storage/bufmgr.h"
 #include "utils/memutils.h"
 
 
index 90eaf11bf1c9d25f665cf50066377994368eb86a..dfd7ca6eec982e22877f08ea5393f0c6a6b5e2e5 100644 (file)
@@ -17,6 +17,7 @@
 #include "access/genam.h"
 #include "access/gist_private.h"
 #include "access/gistscan.h"
+#include "storage/bufmgr.h"
 #include "utils/memutils.h"
 
 static void gistfreestack(GISTSearchStack *s);
index e340731222ffd38b4310e2c9680a5c9edcf7870e..a66ea9e6be87915c1121e34cd0c2d27d97cbf24c 100644 (file)
 #include "postgres.h"
 
 #include "access/gist_private.h"
-#include "access/heapam.h"
 #include "access/reloptions.h"
 #include "storage/freespace.h"
+#include "storage/lmgr.h"
+#include "storage/bufmgr.h"
 
 /*
  * static *S used for temrorary storage (saves stack and palloc() call)
index f495c2f699a02777ba5653e7f7894426539f767b..a5b70af67bc92fc843cd359364e81053b1ebfd90 100644 (file)
 
 #include "access/genam.h"
 #include "access/gist_private.h"
-#include "access/heapam.h"
 #include "commands/vacuum.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "storage/freespace.h"
+#include "storage/lmgr.h"
 #include "utils/memutils.h"
 
 
index adf203d4585a1accdfccedbcdfaeabb37a11c943..81bb7c59ff17289b9e0bfb716ca9d439c8ad1420 100644 (file)
@@ -14,8 +14,9 @@
 #include "postgres.h"
 
 #include "access/gist_private.h"
-#include "access/heapam.h"
+#include "access/xlogutils.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "utils/memutils.h"
 
 
index c0ca636bcd2b51d167a6bc0f66251ac3d6a211eb..f794e6d9ac7bd60fd310c4f7130efca1d122182b 100644 (file)
@@ -25,6 +25,7 @@
 #include "miscadmin.h"
 #include "optimizer/cost.h"
 #include "optimizer/plancat.h"
+#include "storage/bufmgr.h"
 
 
 /* Working state for hashbuild and its callback */
index 6eaafbba8ef627720c3859cafbc6cff413609e0a..677998022447b4cc878db214a8740ee40e43d895 100644 (file)
@@ -16,6 +16,7 @@
 #include "postgres.h"
 
 #include "access/hash.h"
+#include "storage/bufmgr.h"
 
 
 static OffsetNumber _hash_pgaddtup(Relation rel, Buffer buf,
index e39cd68d7319c0d7166318d41bea969b19ffa055..c8c6f0c364ce842de355eaf7cbdf46b17be19973 100644 (file)
@@ -18,6 +18,7 @@
 #include "postgres.h"
 
 #include "access/hash.h"
+#include "storage/bufmgr.h"
 
 
 static Buffer _hash_getovflpage(Relation rel, Buffer metabuf);
index 2bca0368ed4f6b865e2dfe9d2a26d0e8218057bb..b0b58743e0530f04fef49db7483e31180e0ef6e2 100644 (file)
@@ -31,6 +31,7 @@
 #include "access/genam.h"
 #include "access/hash.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "storage/lmgr.h"
 #include "storage/smgr.h"
 #include "utils/lsyscache.h"
index 5d710f59e878683efd6ed30304eea3a1c8a78ffa..648408c06e9088e1fc0b41597987caf24bdd6e10 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "access/hash.h"
 #include "pgstat.h"
+#include "storage/bufmgr.h"
 
 
 /*
index 0839b04ad1aa29f1445d98a6b9eae0e06b6345c1..637d23fc63a829deca2913610d6eaa1a3eabbbad 100644 (file)
@@ -18,6 +18,7 @@
 #include "access/hash.h"
 #include "access/reloptions.h"
 #include "executor/execdebug.h"
+#include "storage/bufmgr.h"
 #include "utils/lsyscache.h"
 
 
index cf19dab45187877ce73abe8b47dd4198da4122ca..6c20b48cc4806892a756c87c80caf46b3f33b197 100644 (file)
 #include "access/heapam.h"
 #include "access/hio.h"
 #include "access/multixact.h"
+#include "access/sysattr.h"
 #include "access/transam.h"
 #include "access/tuptoaster.h"
 #include "access/valid.h"
 #include "access/xact.h"
+#include "access/xlogutils.h"
 #include "catalog/catalog.h"
 #include "catalog/namespace.h"
 #include "miscadmin.h"
 #include "pgstat.h"
+#include "storage/bufmgr.h"
+#include "storage/lmgr.h"
 #include "storage/procarray.h"
 #include "storage/smgr.h"
 #include "utils/datum.h"
index db31906c10f790b3428f60952e69561ba5301eb9..2464c5ba6ac6885b92356d80df1ab00063f36ac5 100644 (file)
 
 #include "postgres.h"
 
-#include "access/heapam.h"
 #include "access/hio.h"
+#include "storage/bufmgr.h"
+#include "storage/bufpage.h"
 #include "storage/freespace.h"
+#include "storage/lmgr.h"
 
 
 /*
index c6741b3d03dc6ca9a1d03e565a0d2ddc9b0d496d..b91f9b7bacba5c0818b63a985ce9684f5cc651c4 100644 (file)
 #include "postgres.h"
 
 #include "access/heapam.h"
+#include "access/htup.h"
 #include "access/transam.h"
 #include "miscadmin.h"
 #include "pgstat.h"
+#include "storage/bufmgr.h"
+#include "storage/bufpage.h"
+#include "storage/off.h"
 #include "utils/inval.h"
 #include "utils/tqual.h"
 
index 775c4e23bdcb647ba80ddc0e2187981fbb5c9338..22cd90d1a683510c6186db3ea28fcf0e6129ae0a 100644 (file)
 #include "access/rewriteheap.h"
 #include "access/transam.h"
 #include "access/tuptoaster.h"
+#include "storage/bufmgr.h"
 #include "storage/smgr.h"
 #include "utils/memutils.h"
 
index f8a3282e24e16ea59f882c32885e99b97cc19384..dfc7265adfec89be5e58beace66dabdb8ea32ed7 100644 (file)
@@ -48,6 +48,9 @@
 
 #include "access/heapam.h"
 #include "miscadmin.h"
+#include "storage/block.h"
+#include "storage/relfilenode.h"
+#include "utils/rel.h"
 
 
 /* GUC variables */
index 7ef02fb94e11ad477dbb21c63d380d54b8188c20..2bf97039e6c747938e78ebca9cff22f295cbaabe 100644 (file)
@@ -66,6 +66,8 @@
 #include "access/heapam.h"
 #include "access/transam.h"
 #include "pgstat.h"
+#include "storage/bufmgr.h"
+#include "storage/lmgr.h"
 #include "utils/relcache.h"
 #include "utils/snapmgr.h"
 #include "utils/tqual.h"
index bfdf50cf2a3f5790e6c71caf9e83d3026c16d8d2..15d4f4306d43936579e64696b67b91dcdb3ff898 100644 (file)
@@ -19,6 +19,8 @@
 #include "access/nbtree.h"
 #include "access/transam.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
+#include "storage/lmgr.h"
 #include "utils/inval.h"
 #include "utils/tqual.h"
 
index ccb1fd9deab0e368008eff79deb2b6ace2406489..e7ffa5311f31dc3d8da84fcd1989f8f3e84a49bb 100644 (file)
@@ -25,6 +25,7 @@
 #include "access/nbtree.h"
 #include "access/transam.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "storage/freespace.h"
 #include "storage/lmgr.h"
 #include "utils/inval.h"
index 36ed78172946140797877e122af0dc36c00724a0..21768f0a2dc3e7e529c12873afdc70f6ab2cc390 100644 (file)
@@ -23,6 +23,7 @@
 #include "catalog/index.h"
 #include "commands/vacuum.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "storage/freespace.h"
 #include "storage/ipc.h"
 #include "storage/lmgr.h"
index c7bd41db41d4bd08fd5dce3ffb305d298a4c3ab0..176190847088f10ab4c1b97d20a2aa67bfb540cb 100644 (file)
@@ -18,6 +18,7 @@
 #include "access/genam.h"
 #include "access/nbtree.h"
 #include "pgstat.h"
+#include "storage/bufmgr.h"
 #include "utils/lsyscache.h"
 
 
index b477bdc0216b9461ce32e6548b931d61405a93d9..0419b68c7e783b69fc7b9e693e7638d5443cac68 100644 (file)
@@ -22,6 +22,7 @@
 #include "access/reloptions.h"
 #include "executor/execdebug.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "storage/lwlock.h"
 #include "storage/shmem.h"
 #include "utils/lsyscache.h"
index 08c188827c89b754cd10a08f48752e029d425815..d56f73cb6d164f2f306a8df14475437058737350 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "access/nbtree.h"
 #include "access/transam.h"
+#include "storage/bufmgr.h"
 
 /*
  * We must keep track of expected insertions due to page splits, and apply
index 4dac0950762cde6c8ab298d487247b0121ea6d53..63c06c04bfedae9da0b7d89c88f6d3204f5ecd71 100644 (file)
@@ -42,7 +42,7 @@
 #include <time.h>
 #include <unistd.h>
 
-#include "access/heapam.h"
+#include "access/htup.h"
 #include "access/subtrans.h"
 #include "access/transam.h"
 #include "access/twophase.h"
index 1a43e8d8d4eaa283afe6165078438e3e75242ecc..a7886dcc8c9f0d48a19b6f1a0badfc8aacd8ee87 100644 (file)
@@ -34,6 +34,7 @@
 #include "libpq/be-fsstubs.h"
 #include "miscadmin.h"
 #include "pgstat.h"
+#include "storage/bufmgr.h"
 #include "storage/fd.h"
 #include "storage/lmgr.h"
 #include "storage/procarray.h"
index e5b7ccde375fc25d69faa6943201ce2624854fa3..22559823c853235e6031b6c0fbb474232fffee0c 100644 (file)
@@ -24,7 +24,6 @@
 #include <unistd.h>
 
 #include "access/clog.h"
-#include "access/heapam.h"
 #include "access/multixact.h"
 #include "access/subtrans.h"
 #include "access/transam.h"
@@ -41,6 +40,7 @@
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "postmaster/bgwriter.h"
+#include "storage/bufmgr.h"
 #include "storage/bufpage.h"
 #include "storage/fd.h"
 #include "storage/ipc.h"
index 1561d4ce2e6e4dc3f12f8864ba4d3d56323aa3ba..fd5e51280e30aa4daac6ff3bacb97d46f0383b6e 100644 (file)
@@ -18,6 +18,7 @@
 #include "postgres.h"
 
 #include "access/xlogutils.h"
+#include "storage/bufmgr.h"
 #include "storage/bufpage.h"
 #include "storage/smgr.h"
 #include "utils/hsearch.h"
index 50f8cb22201b811fa68311e2229887d28b980972..14cb38558de4f6832cb8095e930ac710d9161e2a 100644 (file)
@@ -32,6 +32,7 @@
 #include "nodes/makefuncs.h"
 #include "postmaster/bgwriter.h"
 #include "postmaster/walwriter.h"
+#include "storage/bufmgr.h"
 #include "storage/freespace.h"
 #include "storage/ipc.h"
 #include "storage/proc.h"
index dc9b49f283e4b503a15f91e51598013bb37b1615..dc6ddece7bd86770a772931c24b061a8b56a2340 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "access/genam.h"
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "access/xact.h"
 #include "catalog/catalog.h"
 #include "catalog/dependency.h"
index cd0d9e232cd53561eb45ba9aaabae50f04f26cfb..cc34dd96d0cdab58cf54ae972a18ce644c84ebe5 100644 (file)
@@ -21,6 +21,7 @@
 #include <unistd.h>
 
 #include "access/genam.h"
+#include "access/sysattr.h"
 #include "access/transam.h"
 #include "catalog/catalog.h"
 #include "catalog/indexing.h"
index f60bea3c87baeeecc0afc26bc6443f60dbbefd1d..603564ae36d30a6e5adf7e7e5e69016f4cfef285 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "access/genam.h"
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "access/xact.h"
 #include "catalog/dependency.h"
 #include "catalog/heap.h"
index 070bebc9432d20d74ca764d49f7f0a37a7fc1f90..6b7fdbcebd02e8a12bd366d0f7bb930ce266a9be 100644 (file)
@@ -31,6 +31,7 @@
 
 #include "access/genam.h"
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "access/transam.h"
 #include "access/xact.h"
 #include "catalog/catalog.h"
@@ -54,6 +55,7 @@
 #include "parser/parse_coerce.h"
 #include "parser/parse_expr.h"
 #include "parser/parse_relation.h"
+#include "storage/bufmgr.h"
 #include "storage/smgr.h"
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
index 6db3084ead9b382228018b6540303bffacbc5422..f770bfbbc559168e1c4d645a1f467d8f9cfdadfb 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "access/genam.h"
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "access/transam.h"
 #include "access/xact.h"
 #include "bootstrap/bootstrap.h"
@@ -45,6 +46,8 @@
 #include "optimizer/clauses.h"
 #include "optimizer/var.h"
 #include "parser/parse_expr.h"
+#include "storage/bufmgr.h"
+#include "storage/lmgr.h"
 #include "storage/procarray.h"
 #include "storage/smgr.h"
 #include "utils/builtins.h"
index 42a3de5b7fe8c895455e46696c72f8b319363b40..5a5888e5da34829bdcabd23c702d330136bdecc2 100644 (file)
@@ -15,6 +15,7 @@
 #include "postgres.h"
 
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
 #include "catalog/namespace.h"
index 62830de6e1e381aee930f001051e33393b94be0a..9fb0b0c9ef0d2eaab10213a5eca91c8a53ae50bb 100644 (file)
@@ -36,6 +36,7 @@
 #include "commands/schemacmds.h"
 #include "commands/tablecmds.h"
 #include "commands/typecmds.h"
+#include "storage/lmgr.h"
 #include "miscadmin.h"
 #include "utils/acl.h"
 #include "utils/fmgroids.h"
index c4d61a6100190ef7ab61bf5905159711fae5be3a..1b2945ebd47cc2729b7f9fe7aaf38c4b180db531 100644 (file)
@@ -33,6 +33,7 @@
 #include "parser/parse_relation.h"
 #include "pgstat.h"
 #include "postmaster/autovacuum.h"
+#include "storage/bufmgr.h"
 #include "storage/proc.h"
 #include "storage/procarray.h"
 #include "utils/acl.h"
index 1619cdde9d8b77af61c0e998f1a8d287642eed17..e44a43db7486f734806c942b4e827bc5344558bf 100644 (file)
@@ -34,6 +34,7 @@
 #include "commands/trigger.h"
 #include "commands/vacuum.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "storage/procarray.h"
 #include "utils/acl.h"
 #include "utils/fmgroids.h"
index fc3ebf6ff104c004eb429de1a44ffb788f4b40d0..815524e4fc6a1189735c3c2f81e49fba81dc61bf 100644 (file)
@@ -27,6 +27,7 @@
 #include "access/genam.h"
 #include "access/heapam.h"
 #include "access/xact.h"
+#include "access/xlogutils.h"
 #include "catalog/catalog.h"
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
@@ -40,6 +41,8 @@
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "postmaster/bgwriter.h"
+#include "storage/bufmgr.h"
+#include "storage/lmgr.h"
 #include "storage/freespace.h"
 #include "storage/ipc.h"
 #include "storage/procarray.h"
index 942f64ebf643e56f200b64b548d52c3fb6ad4634..639c5a6dedf2afdf5b59d880fd5ef2624d3442da 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "access/genam.h"
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
 #include "catalog/pg_aggregate.h"
index cdcd8d3ad715eb737ca394ae2d3e4abf59e51682..6fc9a811466be1458a27be1891a598c5b9430eb1 100644 (file)
@@ -38,6 +38,7 @@
 #include "parser/parse_expr.h"
 #include "parser/parse_func.h"
 #include "parser/parsetree.h"
+#include "storage/lmgr.h"
 #include "storage/proc.h"
 #include "storage/procarray.h"
 #include "utils/acl.h"
index 4a18c568f65082d0cd877d8480f755095cb08d70..dcd40e6f57c269b05b2ad0d6507f6ab7d448381a 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "access/genam.h"
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
 #include "catalog/pg_amop.h"
index ee83d01079cded5f9389f056bab92d55bd7dccaa..a523f585ec2f693b4c86e5598da0b3ee54d9afdd 100644 (file)
@@ -16,7 +16,6 @@
  */
 #include "postgres.h"
 
-#include "access/heapam.h"
 #include "access/xact.h"
 #include "catalog/pg_type.h"
 #include "commands/explain.h"
index b053754f2168ecb7ee7c9a60cd60b3cc5d861e12..69ec9e17ecc807b7f748a7ef69b107f5da9733c2 100644 (file)
@@ -17,6 +17,7 @@
 #include "access/heapam.h"
 #include "access/transam.h"
 #include "access/xact.h"
+#include "access/xlogutils.h"
 #include "catalog/dependency.h"
 #include "catalog/namespace.h"
 #include "catalog/pg_type.h"
@@ -25,6 +26,8 @@
 #include "commands/tablecmds.h"
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
+#include "storage/bufmgr.h"
+#include "storage/lmgr.h"
 #include "storage/proc.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
index 4702df2fbd126e4353c91e2dd3b9f88150b33e12..ab101baf46234c30c0da1e0443028d2568e857de 100644 (file)
@@ -17,6 +17,7 @@
 #include "access/genam.h"
 #include "access/heapam.h"
 #include "access/reloptions.h"
+#include "access/sysattr.h"
 #include "access/xact.h"
 #include "catalog/catalog.h"
 #include "catalog/dependency.h"
@@ -58,6 +59,7 @@
 #include "parser/parser.h"
 #include "rewrite/rewriteDefine.h"
 #include "rewrite/rewriteHandler.h"
+#include "storage/bufmgr.h"
 #include "storage/smgr.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
index a89cf5cfaa492bebdc29ac4f110c0e7035839e21..ffc5883236d4e9643f3df740fb80f3455c9c3c6d 100644 (file)
@@ -49,6 +49,7 @@
 #include <sys/stat.h>
 
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "access/xact.h"
 #include "catalog/catalog.h"
 #include "catalog/dependency.h"
index fd835d154fdaa009ea43d6f4a945132a2c9777e3..4062306473780904f19a3f1909f9d8e23a65397a 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "access/genam.h"
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "access/xact.h"
 #include "catalog/catalog.h"
 #include "catalog/dependency.h"
@@ -31,6 +32,7 @@
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "parser/parse_func.h"
+#include "storage/bufmgr.h"
 #include "tcop/utility.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
index 7166ce6919c020dde8994ac7d4ef1b2cdafe3dc7..69c2a49f3709ffbba4dc72cc9651a0c6eb084d35 100644 (file)
@@ -23,6 +23,7 @@
 #include "commands/user.h"
 #include "libpq/md5.h"
 #include "miscadmin.h"
+#include "storage/lmgr.h"
 #include "utils/acl.h"
 #include "utils/builtins.h"
 #include "utils/flatfiles.h"
index ff9ddce147a0d1a2db4de0aa0ffeabb5a4125b12..b1ea791db58a0fd43e8186d3cc34db68fbdc399d 100644 (file)
@@ -37,7 +37,9 @@
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "postmaster/autovacuum.h"
+#include "storage/bufmgr.h"
 #include "storage/freespace.h"
+#include "storage/lmgr.h"
 #include "storage/proc.h"
 #include "storage/procarray.h"
 #include "utils/acl.h"
index 42162d2d98a956d29a27747b893b4c926a77a2b7..a9b8a0a8d422173ec51cf9753cdf80e493599d78 100644 (file)
@@ -54,7 +54,9 @@
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "postmaster/autovacuum.h"
+#include "storage/bufmgr.h"
 #include "storage/freespace.h"
+#include "storage/lmgr.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
 #include "utils/pg_rusage.h"
index 0fcb256b7da7ec27ea1b6ab361571e41547d0c23..a4992cfe16bd81f0faa99c317ea1c0976eebc279 100644 (file)
@@ -12,6 +12,7 @@
  */
 #include "postgres.h"
 
+#include "access/sysattr.h"
 #include "catalog/pg_type.h"
 #include "executor/executor.h"
 #include "utils/builtins.h"
index 014e800f341a2795d2d3d53f05d682032a650b64..c3edf22342437786414deac9cc371a2f73fba9ef 100644 (file)
@@ -48,6 +48,8 @@
 #include "optimizer/clauses.h"
 #include "parser/parse_clause.h"
 #include "parser/parsetree.h"
+#include "storage/bufmgr.h"
+#include "storage/lmgr.h"
 #include "storage/smgr.h"
 #include "utils/acl.h"
 #include "utils/lsyscache.h"
index 68fe5d11c9e9369d40668b9d28d3e2b41b560372..e5e7b05845ab87888afa968ec3a9e0ed1f0817ab 100644 (file)
@@ -36,7 +36,6 @@
 
 #include "postgres.h"
 
-#include "access/heapam.h"
 #include "access/nbtree.h"
 #include "catalog/pg_type.h"
 #include "commands/typecmds.h"
index 30d1591e727af25eef87425d5350cc15ebec38cb..eb200d407c5bb25e8c2337525220cf2ad0b58461 100644 (file)
@@ -92,9 +92,9 @@
 #include "postgres.h"
 
 #include "funcapi.h"
-#include "access/heapam.h"
 #include "catalog/pg_type.h"
 #include "parser/parse_expr.h"
+#include "storage/bufmgr.h"
 #include "utils/lsyscache.h"
 #include "utils/typcache.h"
 
index 328c34928d5ffc397c3df399e3a50f0b6a99a36b..dfe593dca2c78fc4d77e017bae6476bb27ad9de9 100644 (file)
@@ -68,7 +68,6 @@
 
 #include "postgres.h"
 
-#include "access/heapam.h"
 #include "catalog/pg_aggregate.h"
 #include "catalog/pg_proc.h"
 #include "catalog/pg_type.h"
index 4fe71adb71d63596bf1039a514b43146d77067e1..8f8fcc74e382adcd4b35385f91fc430fd14b8694 100644 (file)
@@ -39,6 +39,7 @@
 #include "executor/execdebug.h"
 #include "executor/nodeBitmapHeapscan.h"
 #include "pgstat.h"
+#include "storage/bufmgr.h"
 #include "utils/memutils.h"
 #include "utils/snapmgr.h"
 #include "utils/tqual.h"
index 5432e77eaf785dd22638108e591ab6447ae11b77..7eeff58c79dec0934983165a15deb8242361432e 100644 (file)
@@ -20,7 +20,6 @@
 
 #include <math.h>
 
-#include "access/heapam.h"
 #include "executor/executor.h"
 #include "executor/nodeSubplan.h"
 #include "nodes/makefuncs.h"
index 7a1f5cdaf74a3f7795e0e4822ff6e8506af74cbb..67101b595ade11abf219e815c1264ac003df7aeb 100644 (file)
 #include "postgres.h"
 
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "catalog/pg_type.h"
 #include "executor/execdebug.h"
 #include "executor/nodeTidscan.h"
 #include "optimizer/clauses.h"
+#include "storage/bufmgr.h"
 #include "utils/array.h"
 
 
index ca54c603a4763fa3e11164d3ba98182040faf1d0..4e8d91ad0f4dd1026a80d459c2525bffee2a87cb 100644 (file)
@@ -15,6 +15,7 @@
 #include "postgres.h"
 
 #include "access/printtup.h"
+#include "access/sysattr.h"
 #include "catalog/heap.h"
 #include "commands/trigger.h"
 #include "executor/spi_priv.h"
index d42a7db5774b92e9a340ad3d71ee520b440034c5..89dcf31ee66cc7502e60941ffa70ae2ee1e912e2 100644 (file)
@@ -36,7 +36,7 @@
  */
 #include "postgres.h"
 
-#include "access/htup.h"
+#include "access/sysattr.h"
 #include "catalog/pg_operator.h"
 #include "catalog/pg_type.h"
 #include "optimizer/clauses.h"
index d20c26263b7adf49ebe2f11e51f9dfcdb58953d3..42549b294833ec9c80cc3341337d7460d73525ea 100644 (file)
@@ -24,6 +24,7 @@
 #include "postgres.h"
 
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "catalog/pg_type.h"
 #include "nodes/makefuncs.h"
 #include "optimizer/prep.h"
index 6935ec7ae8d84db1247e4d809535009d19a97387..cf10c34f2b0623d0adef80ccb5483e27ec6ab0f5 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "postgres.h"
 
-#include "access/heapam.h"
 #include "catalog/pg_aggregate.h"
 #include "catalog/pg_language.h"
 #include "catalog/pg_operator.h"
index d10ba4cae58fdf9ba148e18314d6f0b8813fd5fa..475c313775d0aab956d39f0b1af2f171d81beb6e 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "access/genam.h"
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "access/transam.h"
 #include "catalog/catalog.h"
 #include "catalog/pg_inherits.h"
@@ -32,6 +33,7 @@
 #include "parser/parse_relation.h"
 #include "parser/parsetree.h"
 #include "rewrite/rewriteManip.h"
+#include "storage/bufmgr.h"
 #include "utils/fmgroids.h"
 #include "utils/lsyscache.h"
 #include "utils/relcache.h"
index a5c577cab2a0bc07b1f79e7875d65e51135aa220..7f3c82872a557f00f0b675e2fa5b35ec9e37c306 100644 (file)
@@ -14,7 +14,7 @@
  */
 #include "postgres.h"
 
-#include "access/htup.h"
+#include "access/sysattr.h"
 #include "optimizer/clauses.h"
 #include "optimizer/prep.h"
 #include "optimizer/var.h"
index 737b093a1b4b99e7ab5cfe13bf7e9d4de6d1548d..dd626a6a1b191df38f644b10cc0eb7a57e1cd33e 100644 (file)
@@ -17,6 +17,7 @@
 #include <ctype.h>
 
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "catalog/heap.h"
 #include "catalog/namespace.h"
 #include "catalog/pg_type.h"
index cc78cf0fc1f69a5d974ee4da1bd4d537cc0610bc..188fd2ab5d55d6ff14f1960a992dc863ed51a533 100644 (file)
@@ -84,6 +84,7 @@
 #include "postmaster/autovacuum.h"
 #include "postmaster/fork_process.h"
 #include "postmaster/postmaster.h"
+#include "storage/bufmgr.h"
 #include "storage/fd.h"
 #include "storage/ipc.h"
 #include "storage/pmsignal.h"
index 97b6b3c2d44f472565d21e158fc63e41e7c5804f..a9afa183d96fff2e365bc590a835e5fb4fe5900b 100644 (file)
@@ -53,6 +53,7 @@
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "postmaster/bgwriter.h"
+#include "storage/bufmgr.h"
 #include "storage/fd.h"
 #include "storage/freespace.h"
 #include "storage/ipc.h"
index b99c3dc2e087c997bf470e3bd3da8dbbb61486d2..3b256717c0be234a5ff1ddf135af52a9eb21d6df 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "access/genam.h"
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
 #include "catalog/pg_rewrite.h"
index f098d1a307691bcdd06e9019abd24ad08febda39..f63b49c34ba2557136b0934e6e347589d3678357 100644 (file)
@@ -36,6 +36,7 @@
 #include "miscadmin.h"
 #include "postmaster/bgwriter.h"
 #include "storage/buf_internals.h"
+#include "storage/bufmgr.h"
 #include "storage/bufpage.h"
 #include "storage/ipc.h"
 #include "storage/proc.h"
index ff87ba11d6167fa773ec9a9af45279198486ed59..5ec922b192bde61a26e179c3b1e97578fe18578c 100644 (file)
@@ -25,6 +25,7 @@
 #include "postmaster/autovacuum.h"
 #include "postmaster/bgwriter.h"
 #include "postmaster/postmaster.h"
+#include "storage/bufmgr.h"
 #include "storage/freespace.h"
 #include "storage/ipc.h"
 #include "storage/pg_shmem.h"
index 56efa4cbf7a5038de214773c333680ebe00db83c..6e74d57df3818b3c5c60bad29211188633809be2 100644 (file)
@@ -54,6 +54,7 @@
 #include "parser/parser.h"
 #include "postmaster/autovacuum.h"
 #include "rewrite/rewriteHandler.h"
+#include "storage/bufmgr.h"
 #include "storage/freespace.h"
 #include "storage/ipc.h"
 #include "storage/proc.h"
index 996d3bcc2631704ff9f00718d04fe5f9832df3e5..829dcc3fb5dba9f275145f83ca6d7d768fe40be9 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "funcapi.h"
 #include "access/genam.h"
-#include "access/heapam.h"
 #include "access/skey.h"
 #include "catalog/indexing.h"
 #include "catalog/namespace.h"
index ae64195e3bd3a5dbb08236a2fdb52ced06d76b86..57eca82d3ce4c8384352c3cc37cf163b9d83f7f3 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <ctype.h>
 
-#include "access/tupmacs.h"
 #include "funcapi.h"
 #include "libpq/pqformat.h"
 #include "parser/parse_coerce.h"
index b5b98af2da23e8fbc8fe90bdb0043465b5846584..a88323ff69be129e529bc954a572bf90b7ef3356 100644 (file)
@@ -19,7 +19,6 @@
 #include <limits.h>
 #include <math.h>
 
-#include "access/heapam.h"
 #include "access/xact.h"
 #include "catalog/pg_type.h"
 #include "funcapi.h"
index 211e17a27d92fab7c1a04e681000650fc744b646..b36fa5d8e20e1b6d7e63be8601c6643852a6b580 100644 (file)
@@ -20,7 +20,6 @@
 #include <unistd.h>
 #include <dirent.h>
 
-#include "access/heapam.h"
 #include "catalog/pg_type.h"
 #include "funcapi.h"
 #include "miscadmin.h"
index 3248951089e1501d996643dbdc6be091f47c5c0b..09cf1df9f4f9e0cb8b9e00b65d921175abdf1b49 100644 (file)
@@ -12,7 +12,6 @@
  */
 #include "postgres.h"
 
-#include "access/heapam.h"
 #include "catalog/pg_type.h"
 #include "funcapi.h"
 #include "miscadmin.h"
index a7fcce8d6056e653d1506229b9cdef681bfb13f1..30a4dda2f60f9d02a51d53d9067b79feec6f3971 100644 (file)
@@ -18,7 +18,6 @@
 #include "miscadmin.h"
 #include "pgstat.h"
 #include "catalog/pg_type.h"
-#include "access/heapam.h"
 #include "utils/builtins.h"
 #include "utils/inet.h"
 #include "libpq/ip.h"
index 1d7420e3ee4e5406cc8ac36f555a9b8f4a34106c..8b8e2b2ddd2cdbcaf5fa7058ad8843e8948a62e0 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <ctype.h>
 
-#include "access/heapam.h"
 #include "catalog/pg_type.h"
 #include "libpq/pqformat.h"
 #include "utils/builtins.h"
index dbeff273625ff579e76afc59cb280f7d29fb3fee..f400ca273afe20921794c503da594c82af0daca6 100644 (file)
@@ -19,6 +19,7 @@
 #include <fcntl.h>
 
 #include "access/genam.h"
+#include "access/sysattr.h"
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
 #include "catalog/pg_authid.h"
index 1d02c9594681f78d5aea8aaf945e9bf8b1aee6f2..596d35ba7ca5ebd11cb03fac2201ddec1da99208 100644 (file)
@@ -76,6 +76,7 @@
 #include <ctype.h>
 #include <math.h>
 
+#include "access/sysattr.h"
 #include "catalog/pg_opfamily.h"
 #include "catalog/pg_statistic.h"
 #include "catalog/pg_type.h"
index 4784df774a7b2489fe2915725d9ad702711b089d..1ab73a66fc47fa5ccf81c7f0cb4c9d66c7f40367 100644 (file)
@@ -21,6 +21,7 @@
 #include <limits.h>
 
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "catalog/namespace.h"
 #include "catalog/pg_type.h"
 #include "libpq/pqformat.h"
index 657f0f89b8681d83673ea376328a4f9ee5ecdab2..3289c395da738a01eb2270b7047d9beaa3be2fd2 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <ctype.h>
 
-#include "access/tupmacs.h"
 #include "access/tuptoaster.h"
 #include "catalog/pg_type.h"
 #include "libpq/md5.h"
index 9ad3ff81fde5d19605e605da4b64576ecc4f02fb..708fe5f72f820d370c8441fa6866f6d636594276 100644 (file)
@@ -81,7 +81,6 @@
 #include "utils/datetime.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
-#include "access/tupmacs.h"
 #include "utils/xml.h"
 
 
index 3f3c67d53e8712f9d1d95836c5ed1f7c7e2466de..7affec2d099169ecf90e4e456ff936c605d078e0 100644 (file)
@@ -17,6 +17,7 @@
 #include "access/genam.h"
 #include "access/hash.h"
 #include "access/heapam.h"
+#include "access/sysattr.h"
 #include "access/valid.h"
 #include "catalog/pg_operator.h"
 #include "catalog/pg_type.h"
index c1080aa459e21d64f7c844dec4026a517b100e90..74c70f28ae73b4378ef9290f00019b8bfc93a1f1 100644 (file)
@@ -32,6 +32,7 @@
 #include "access/genam.h"
 #include "access/heapam.h"
 #include "access/reloptions.h"
+#include "access/sysattr.h"
 #include "access/xact.h"
 #include "catalog/catalog.h"
 #include "catalog/index.h"
@@ -55,6 +56,7 @@
 #include "optimizer/var.h"
 #include "rewrite/rewriteDefine.h"
 #include "storage/fd.h"
+#include "storage/lmgr.h"
 #include "storage/smgr.h"
 #include "utils/builtins.h"
 #include "utils/fmgroids.h"
index b8b1a431f81aeaf17e16cbcbc8e7c5e3de6f0bdf..adb4d6b80a5c6f630d56a0526462e000a83433cd 100644 (file)
@@ -20,7 +20,7 @@
  */
 #include "postgres.h"
 
-#include "access/heapam.h"
+#include "access/sysattr.h"
 #include "catalog/indexing.h"
 #include "catalog/pg_aggregate.h"
 #include "catalog/pg_amop.h"
index 72d3ecf5151002f88373132f983ad28798a9c4ef..c74bfd5c16caa80186c15353c59ccfceb61863c3 100644 (file)
@@ -15,7 +15,6 @@
 
 #include "postgres.h"
 
-#include "access/heapam.h"
 #include "access/tuptoaster.h"
 #include "catalog/pg_language.h"
 #include "catalog/pg_proc.h"
index 8addd6e39749232892ae4f29aaad83863ad68230..4ec268026530a956e0d625fcf8a695f5cf472b34 100644 (file)
@@ -36,6 +36,7 @@
 #include "access/transam.h"
 #include "access/twophase_rmgr.h"
 #include "access/xact.h"
+#include "access/xlogutils.h"
 #include "catalog/catalog.h"
 #include "catalog/pg_auth_members.h"
 #include "catalog/pg_authid.h"
@@ -44,7 +45,9 @@
 #include "catalog/pg_tablespace.h"
 #include "commands/trigger.h"
 #include "miscadmin.h"
+#include "storage/bufmgr.h"
 #include "storage/fd.h"
+#include "storage/lmgr.h"
 #include "storage/pmsignal.h"
 #include "utils/builtins.h"
 #include "utils/flatfiles.h"
index c848797f7d666d398e19c7e041c12420ec68cfed..f8ad868677768f6a481b56bae8381d49601c04d1 100644 (file)
 #include "postmaster/autovacuum.h"
 #include "postmaster/postmaster.h"
 #include "storage/backendid.h"
+#include "storage/bufmgr.h"
 #include "storage/fd.h"
 #include "storage/ipc.h"
+#include "storage/lmgr.h"
 #include "storage/proc.h"
 #include "storage/procarray.h"
 #include "storage/sinvaladt.h"
index 4c3e2c874c6571c79589c4da8edd6f06dc9f6dd0..c1ea498da1f6b709f678bb2c655526ce94df540e 100644 (file)
@@ -55,6 +55,7 @@
 #include "postmaster/syslogger.h"
 #include "postmaster/walwriter.h"
 #include "regex/regex.h"
+#include "storage/bufmgr.h"
 #include "storage/fd.h"
 #include "storage/freespace.h"
 #include "tcop/tcopprot.h"
index a4db2ae2f81d7618a035c572951030cec9157f0e..1117af42a4f8dfc8829d9f49fab71a62fb598d7d 100644 (file)
@@ -18,7 +18,6 @@
  */
 #include "postgres.h"
 
-#include "access/heapam.h"
 #include "access/xact.h"
 #include "catalog/pg_type.h"
 #include "commands/portalcmds.h"
index 3c4a5ee4a66b2e494e40814839a9184e3bf61dad..b68014d76c2584d2c58db2d4a118b4ba42ce548c 100644 (file)
@@ -21,6 +21,7 @@
 #include "postgres.h"
 
 #include "access/hash.h"
+#include "storage/bufmgr.h"
 #include "storage/proc.h"
 #include "utils/memutils.h"
 #include "utils/resowner.h"
index 85658f07eb333859fc1a29171aa1d2f3a9119b0e..a0a6bd7a5066f3e45c3cc6b16ce1b117a2e6c661 100644 (file)
 
 #include "access/genam.h"
 #include "access/hash.h"
-#include "access/heapam.h"
 #include "access/nbtree.h"
 #include "catalog/pg_amop.h"
 #include "catalog/pg_operator.h"
index 435cfc0e5cecdf2d3f1335c47e80a6ccceb2817f..987355cd104922fcc8d635cc0740f6a14126eae0 100644 (file)
@@ -45,7 +45,6 @@
 
 #include "postgres.h"
 
-#include "access/heapam.h"
 #include "commands/tablespace.h"
 #include "executor/executor.h"
 #include "storage/buffile.h"
index 95199234acc54d1aa131290cfe3a8434d57a8041..3334118de49faf9dfe270546541550d844f592c6 100644 (file)
@@ -35,7 +35,7 @@ int                   optreset;
 #endif
 
 #include "access/attnum.h"
-#include "access/htup.h"
+#include "access/sysattr.h"
 #include "catalog/pg_class.h"
 #include "catalog/pg_proc.h"
 #include "catalog/pg_trigger.h"
index b07993bfe899868ef35bf3c71c7c03ba4fff4e24..b4d534ec296e7ed78a6f999c9daa58ce303ec8ac 100644 (file)
 
 #include "access/relscan.h"
 #include "access/sdir.h"
-#include "nodes/primnodes.h"
 #include "nodes/tidbitmap.h"
+#include "storage/buf.h"
 #include "storage/lock.h"
+#include "utils/rel.h"
 
 /*
  * Struct for statistics returned by ambuild
index 5fbf35eff2bd0da9c9ece6ee8e4b852f806412b7..2a5247dc0bf63347c2eb13adcb1bf4fd3452434e 100644 (file)
 #ifndef GIN_H
 #define GIN_H
 
-#include "access/relscan.h"
-#include "access/skey.h"
-#include "access/xlog.h"
-#include "access/xlogdefs.h"
-#include "storage/bufpage.h"
-#include "storage/off.h"
-#include "utils/rel.h"
 #include "access/itup.h"
+#include "access/relscan.h"
 #include "fmgr.h"
+#include "storage/block.h"
+#include "storage/buf.h"
+#include "storage/off.h"
+#include "storage/relfilenode.h"
 
 
 /*
index fe7c6a3ec2a12ffb1527e2709ee5d4d58b36ccfd..106de89a061c9eb670c50557c3ca13d4da476ee9 100644 (file)
@@ -19,7 +19,6 @@
 #include "access/xlog.h"
 #include "access/xlogdefs.h"
 #include "storage/bufpage.h"
-#include "storage/off.h"
 #include "utils/rel.h"
 
 /*
index 7a00a995479efb19634f18c7e2f3b181aa08ec1f..fc2385a079ca48f4800e673d3353c9a65090f0b3 100644 (file)
@@ -14,7 +14,7 @@
 #ifndef GISTSCAN_H
 #define GISTSCAN_H
 
-#include "access/relscan.h"
+#include "fmgr.h"
 
 extern Datum gistbeginscan(PG_FUNCTION_ARGS);
 extern Datum gistrescan(PG_FUNCTION_ARGS);
index d0f41d264f98992593ed96f399b7ab175fc30aac..f29f835e9050c4663cd8148089713ca0cc9b21c0 100644 (file)
 #include "access/htup.h"
 #include "access/relscan.h"
 #include "access/sdir.h"
-#include "access/tupmacs.h"
-#include "access/xlogutils.h"
 #include "nodes/primnodes.h"
-#include "storage/block.h"
-#include "storage/lmgr.h"
-#include "utils/rel.h"
+#include "storage/lock.h"
 #include "utils/snapshot.h"
 
-/* ----------------
- *             fastgetattr
- *
- *             Fetch a user attribute's value as a Datum (might be either a
- *             value, or a pointer into the data area of the tuple).
- *
- *             This must not be used when a system attribute might be requested.
- *             Furthermore, the passed attnum MUST be valid.  Use heap_getattr()
- *             instead, if in doubt.
- *
- *             This gets called many times, so we macro the cacheable and NULL
- *             lookups, and call nocachegetattr() for the rest.
- * ----------------
- */
-
-#if !defined(DISABLE_COMPLEX_MACRO)
-
-#define fastgetattr(tup, attnum, tupleDesc, isnull)                                    \
-(                                                                                                                                      \
-       AssertMacro((attnum) > 0),                                                                              \
-       (((isnull) != NULL) ? (*(isnull) = false) : (dummyret)NULL),                            \
-       HeapTupleNoNulls(tup) ?                                                                                 \
-       (                                                                                                                               \
-               (tupleDesc)->attrs[(attnum)-1]->attcacheoff >= 0 ?                      \
-               (                                                                                                                       \
-                       fetchatt((tupleDesc)->attrs[(attnum)-1],                                \
-                               (char *) (tup)->t_data + (tup)->t_data->t_hoff +        \
-                                       (tupleDesc)->attrs[(attnum)-1]->attcacheoff)    \
-               )                                                                                                                       \
-               :                                                                                                                       \
-                       nocachegetattr((tup), (attnum), (tupleDesc), (isnull))  \
-       )                                                                                                                               \
-       :                                                                                                                               \
-       (                                                                                                                               \
-               att_isnull((attnum)-1, (tup)->t_data->t_bits) ?                         \
-               (                                                                                                                       \
-                       (((isnull) != NULL) ? (*(isnull) = true) : (dummyret)NULL),             \
-                       (Datum)NULL                                                                                             \
-               )                                                                                                                       \
-               :                                                                                                                       \
-               (                                                                                                                       \
-                       nocachegetattr((tup), (attnum), (tupleDesc), (isnull))  \
-               )                                                                                                                       \
-       )                                                                                                                               \
-)
-#else                                                  /* defined(DISABLE_COMPLEX_MACRO) */
-
-extern Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
-                       bool *isnull);
-#endif   /* defined(DISABLE_COMPLEX_MACRO) */
-
-
-/* ----------------
- *             heap_getattr
- *
- *             Extract an attribute of a heap tuple and return it as a Datum.
- *             This works for either system or user attributes.  The given attnum
- *             is properly range-checked.
- *
- *             If the field in question has a NULL value, we return a zero Datum
- *             and set *isnull == true.  Otherwise, we set *isnull == false.
- *
- *             <tup> is the pointer to the heap tuple.  <attnum> is the attribute
- *             number of the column (field) caller wants.      <tupleDesc> is a
- *             pointer to the structure describing the row and all its fields.
- * ----------------
- */
-#define heap_getattr(tup, attnum, tupleDesc, isnull) \
-( \
-       AssertMacro((tup) != NULL), \
-       ( \
-               ((attnum) > 0) ? \
-               ( \
-                       ((attnum) > (int) HeapTupleHeaderGetNatts((tup)->t_data)) ? \
-                       ( \
-                               (((isnull) != NULL) ? (*(isnull) = true) : (dummyret)NULL), \
-                               (Datum)NULL \
-                       ) \
-                       : \
-                               fastgetattr((tup), (attnum), (tupleDesc), (isnull)) \
-               ) \
-               : \
-                       heap_getsysattr((tup), (attnum), (tupleDesc), (isnull)) \
-       ) \
-)
-
 
 typedef enum
 {
@@ -207,48 +117,6 @@ extern XLogRecPtr log_heap_freeze(Relation reln, Buffer buffer,
                                OffsetNumber *offsets, int offcnt);
 extern XLogRecPtr log_newpage(RelFileNode *rnode, BlockNumber blk, Page page);
 
-/* in common/heaptuple.c */
-extern Size heap_compute_data_size(TupleDesc tupleDesc,
-                                          Datum *values, bool *isnull);
-extern void heap_fill_tuple(TupleDesc tupleDesc,
-                               Datum *values, bool *isnull,
-                               char *data, Size data_size,
-                               uint16 *infomask, bits8 *bit);
-extern bool heap_attisnull(HeapTuple tup, int attnum);
-extern Datum nocachegetattr(HeapTuple tup, int attnum,
-                          TupleDesc att, bool *isnull);
-extern Datum heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
-                               bool *isnull);
-extern HeapTuple heap_copytuple(HeapTuple tuple);
-extern void heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest);
-extern HeapTuple heap_form_tuple(TupleDesc tupleDescriptor,
-                               Datum *values, bool *isnull);
-extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor,
-                          Datum *values, char *nulls);
-extern HeapTuple heap_modify_tuple(HeapTuple tuple,
-                                 TupleDesc tupleDesc,
-                                 Datum *replValues,
-                                 bool *replIsnull,
-                                 bool *doReplace);
-extern HeapTuple heap_modifytuple(HeapTuple tuple,
-                                TupleDesc tupleDesc,
-                                Datum *replValues,
-                                char *replNulls,
-                                char *replActions);
-extern void heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc,
-                                 Datum *values, bool *isnull);
-extern void heap_deformtuple(HeapTuple tuple, TupleDesc tupleDesc,
-                                Datum *values, char *nulls);
-extern void heap_freetuple(HeapTuple htup);
-extern MinimalTuple heap_form_minimal_tuple(TupleDesc tupleDescriptor,
-                                               Datum *values, bool *isnull);
-extern void heap_free_minimal_tuple(MinimalTuple mtup);
-extern MinimalTuple heap_copy_minimal_tuple(MinimalTuple mtup);
-extern HeapTuple heap_tuple_from_minimal_tuple(MinimalTuple mtup);
-extern MinimalTuple minimal_tuple_from_heap_tuple(HeapTuple htup);
-extern HeapTuple heap_addheader(int natts, bool withoid,
-                          Size structlen, void *structure);
-
 /* in heap/pruneheap.c */
 extern void heap_page_prune_opt(Relation relation, Buffer buffer,
                                        TransactionId OldestXmin);
index 53ac9fbda57931a41481fb17deeaaa76e8c98c81..f202959ee780c5e5391a625ad1f67196e4fdb6de 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef HTUP_H
 #define HTUP_H
 
+#include "access/tupdesc.h"
+#include "access/tupmacs.h"
 #include "storage/itemptr.h"
 #include "storage/relfilenode.h"
 
@@ -392,19 +394,6 @@ do { \
 #define MaxAttrSize            (10 * 1024 * 1024)
 
 
-/*
- * Attribute numbers for the system-defined attributes
- */
-#define SelfItemPointerAttributeNumber                 (-1)
-#define ObjectIdAttributeNumber                                        (-2)
-#define MinTransactionIdAttributeNumber                        (-3)
-#define MinCommandIdAttributeNumber                            (-4)
-#define MaxTransactionIdAttributeNumber                        (-5)
-#define MaxCommandIdAttributeNumber                            (-6)
-#define TableOidAttributeNumber                                        (-7)
-#define FirstLowInvalidHeapAttributeNumber             (-8)
-
-
 /*
  * MinimalTuple is an alternative representation that is used for transient
  * tuples inside the executor, in places where transaction status information
@@ -725,4 +714,132 @@ extern void HeapTupleHeaderAdjustCmax(HeapTupleHeader tup,
                                                  CommandId *cmax,
                                                  bool *iscombo);
 
+/* ----------------
+ *             fastgetattr
+ *
+ *             Fetch a user attribute's value as a Datum (might be either a
+ *             value, or a pointer into the data area of the tuple).
+ *
+ *             This must not be used when a system attribute might be requested.
+ *             Furthermore, the passed attnum MUST be valid.  Use heap_getattr()
+ *             instead, if in doubt.
+ *
+ *             This gets called many times, so we macro the cacheable and NULL
+ *             lookups, and call nocachegetattr() for the rest.
+ * ----------------
+ */
+
+#if !defined(DISABLE_COMPLEX_MACRO)
+
+#define fastgetattr(tup, attnum, tupleDesc, isnull)                                    \
+(                                                                                                                                      \
+       AssertMacro((attnum) > 0),                                                                              \
+       (((isnull) != NULL) ? (*(isnull) = false) : (dummyret)NULL),    \
+       HeapTupleNoNulls(tup) ?                                                                                 \
+       (                                                                                                                               \
+               (tupleDesc)->attrs[(attnum)-1]->attcacheoff >= 0 ?                      \
+               (                                                                                                                       \
+                       fetchatt((tupleDesc)->attrs[(attnum)-1],                                \
+                               (char *) (tup)->t_data + (tup)->t_data->t_hoff +        \
+                                       (tupleDesc)->attrs[(attnum)-1]->attcacheoff)    \
+               )                                                                                                                       \
+               :                                                                                                                       \
+                       nocachegetattr((tup), (attnum), (tupleDesc), (isnull))  \
+       )                                                                                                                               \
+       :                                                                                                                               \
+       (                                                                                                                               \
+               att_isnull((attnum)-1, (tup)->t_data->t_bits) ?                         \
+               (                                                                                                                       \
+                       (((isnull) != NULL) ? (*(isnull) = true) : (dummyret)NULL),             \
+                       (Datum)NULL                                                                                             \
+               )                                                                                                                       \
+               :                                                                                                                       \
+               (                                                                                                                       \
+                       nocachegetattr((tup), (attnum), (tupleDesc), (isnull))  \
+               )                                                                                                                       \
+       )                                                                                                                               \
+)
+#else                                                  /* defined(DISABLE_COMPLEX_MACRO) */
+
+extern Datum fastgetattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
+                       bool *isnull);
+#endif   /* defined(DISABLE_COMPLEX_MACRO) */
+
+
+/* ----------------
+ *             heap_getattr
+ *
+ *             Extract an attribute of a heap tuple and return it as a Datum.
+ *             This works for either system or user attributes.  The given attnum
+ *             is properly range-checked.
+ *
+ *             If the field in question has a NULL value, we return a zero Datum
+ *             and set *isnull == true.  Otherwise, we set *isnull == false.
+ *
+ *             <tup> is the pointer to the heap tuple.  <attnum> is the attribute
+ *             number of the column (field) caller wants.      <tupleDesc> is a
+ *             pointer to the structure describing the row and all its fields.
+ * ----------------
+ */
+#define heap_getattr(tup, attnum, tupleDesc, isnull) \
+( \
+       AssertMacro((tup) != NULL), \
+       ( \
+               ((attnum) > 0) ? \
+               ( \
+                       ((attnum) > (int) HeapTupleHeaderGetNatts((tup)->t_data)) ? \
+                       ( \
+                               (((isnull) != NULL) ? (*(isnull) = true) : (dummyret)NULL), \
+                               (Datum)NULL \
+                       ) \
+                       : \
+                               fastgetattr((tup), (attnum), (tupleDesc), (isnull)) \
+               ) \
+               : \
+                       heap_getsysattr((tup), (attnum), (tupleDesc), (isnull)) \
+       ) \
+)
+
+/* prototypes for functions in common/heaptuple.c */
+extern Size heap_compute_data_size(TupleDesc tupleDesc,
+                                          Datum *values, bool *isnull);
+extern void heap_fill_tuple(TupleDesc tupleDesc,
+                               Datum *values, bool *isnull,
+                               char *data, Size data_size,
+                               uint16 *infomask, bits8 *bit);
+extern bool heap_attisnull(HeapTuple tup, int attnum);
+extern Datum nocachegetattr(HeapTuple tup, int attnum,
+                          TupleDesc att, bool *isnull);
+extern Datum heap_getsysattr(HeapTuple tup, int attnum, TupleDesc tupleDesc,
+                               bool *isnull);
+extern HeapTuple heap_copytuple(HeapTuple tuple);
+extern void heap_copytuple_with_tuple(HeapTuple src, HeapTuple dest);
+extern HeapTuple heap_form_tuple(TupleDesc tupleDescriptor,
+                               Datum *values, bool *isnull);
+extern HeapTuple heap_formtuple(TupleDesc tupleDescriptor,
+                          Datum *values, char *nulls);
+extern HeapTuple heap_modify_tuple(HeapTuple tuple,
+                                 TupleDesc tupleDesc,
+                                 Datum *replValues,
+                                 bool *replIsnull,
+                                 bool *doReplace);
+extern HeapTuple heap_modifytuple(HeapTuple tuple,
+                                TupleDesc tupleDesc,
+                                Datum *replValues,
+                                char *replNulls,
+                                char *replActions);
+extern void heap_deform_tuple(HeapTuple tuple, TupleDesc tupleDesc,
+                                 Datum *values, bool *isnull);
+extern void heap_deformtuple(HeapTuple tuple, TupleDesc tupleDesc,
+                                Datum *values, char *nulls);
+extern void heap_freetuple(HeapTuple htup);
+extern MinimalTuple heap_form_minimal_tuple(TupleDesc tupleDescriptor,
+                                               Datum *values, bool *isnull);
+extern void heap_free_minimal_tuple(MinimalTuple mtup);
+extern MinimalTuple heap_copy_minimal_tuple(MinimalTuple mtup);
+extern HeapTuple heap_tuple_from_minimal_tuple(MinimalTuple mtup);
+extern MinimalTuple minimal_tuple_from_heap_tuple(HeapTuple htup);
+extern HeapTuple heap_addheader(int natts, bool withoid,
+                          Size structlen, void *structure);
+
 #endif   /* HTUP_H */
index 0b81fd627124d3dc928e9e211f47fe523a770baf..d13af937399cba29d7da7ab2004cbc5d32a50169 100644 (file)
@@ -17,6 +17,7 @@
 #include "access/htup.h"
 #include "access/skey.h"
 #include "storage/bufpage.h"
+#include "utils/rel.h"
 #include "utils/snapshot.h"
 
 
diff --git a/src/include/access/sysattr.h b/src/include/access/sysattr.h
new file mode 100644 (file)
index 0000000..f3a24a5
--- /dev/null
@@ -0,0 +1,31 @@
+/*-------------------------------------------------------------------------
+ *
+ * sysattr.h
+ *       POSTGRES system attribute definitions.
+ *
+ *
+ * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $PostgreSQL$
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef SYSATTR_H
+#define SYSATTR_H
+
+
+/*
+ * Attribute numbers for the system-defined attributes
+ */
+#define SelfItemPointerAttributeNumber                 (-1)
+#define ObjectIdAttributeNumber                                        (-2)
+#define MinTransactionIdAttributeNumber                        (-3)
+#define MinCommandIdAttributeNumber                            (-4)
+#define MaxTransactionIdAttributeNumber                        (-5)
+#define MaxCommandIdAttributeNumber                            (-6)
+#define TableOidAttributeNumber                                        (-7)
+#define FirstLowInvalidHeapAttributeNumber             (-8)
+
+
+#endif   /* SYSATTR_H */
index 308fb086463aeab6271c0dfbac292b1922264c97..47b015fb4427a01334eb76e5397f67c076319da3 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "access/htup.h"
 #include "storage/bufpage.h"
+#include "utils/rel.h"
 
 /*
  * This enables de-toasting of index entries.  Needed until VACUUM is
index a60e83197c13f7edcf5a10fb4359ca34b9d41ba0..62e2c593f480a46601c881a73cf428e26a0b0809 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef PARSER_H
 #define PARSER_H
 
+#include "nodes/pg_list.h"
+
 extern List *raw_parser(const char *str);
 
 #endif   /* PARSER_H */
index 2a4db46c8bd737813807249130190074357d0cc4..93fe22a0892891c37b6d591459e46ca2bd9bbdee 100644 (file)
@@ -15,6 +15,7 @@
 #define REWRITEDEFINE_H
 
 #include "nodes/parsenodes.h"
+#include "utils/rel.h"
 
 #define RULE_FIRES_ON_ORIGIN   'O'
 #define RULE_FIRES_ALWAYS              'A'
index 4245aef0e5c681815cb899fac6a38ec6ac3ca6bd..c72e1505c20411006e5e24368c898cb5c665b5eb 100644 (file)
 #ifndef BUFPAGE_H
 #define BUFPAGE_H
 
-#include "storage/bufmgr.h"
+#include "access/xlog.h"
 #include "storage/item.h"
 #include "storage/off.h"
-#include "access/xlog.h"
 
 /*
  * A postgres disk page is an abstraction layered on top of a postgres
index 42a890eb9ddfea62d5abc969af21122bf2efd578..de013ac27cf3058e7fd430c63c6a5d8358e224cd 100644 (file)
@@ -15,6 +15,7 @@
 #define LMGR_H
 
 #include "lib/stringinfo.h"
+#include "storage/itemptr.h"
 #include "storage/lock.h"
 #include "utils/rel.h"
 
index e335d753303ba3ef3148555d5ed0ae02f3f780fb..1deaf8dcd8d322f4496ee3b061aa9396ff6d00aa 100644 (file)
@@ -14,9 +14,7 @@
 #ifndef LOCK_H_
 #define LOCK_H_
 
-#include "nodes/pg_list.h"
 #include "storage/backendid.h"
-#include "storage/itemptr.h"
 #include "storage/lwlock.h"
 #include "storage/shmem.h"
 
index 1b0731fa809322cd4d2be3278f573167882c7f82..ce3261dc3550538bc0f6ed7c71223ac0c985facf 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "access/itup.h"
 #include "executor/tuptable.h"
+#include "utils/rel.h"
 
 
 /* Tuplesortstate is an opaque type whose details are not known outside
index cbb6309dafb2a0b03ee71f0814cb0ff123a065ed..c67902ebd8870ec977b57304702494b448907ae4 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "pl.tab.h"
 
-#include "access/heapam.h"
 #include "catalog/namespace.h"
 #include "catalog/pg_attrdef.h"
 #include "catalog/pg_attribute.h"
index d8cd96623015ec7e01397591f1e19edea960aceb..8335ef09892d4e3312ac97a9a1f16d923ef84fa8 100644 (file)
@@ -18,7 +18,6 @@
 
 #include <ctype.h>
 
-#include "access/heapam.h"
 #include "access/transam.h"
 #include "catalog/pg_proc.h"
 #include "catalog/pg_type.h"
index 90245f0a66e5d5a786bbe2f482db9d9732dfbab6..6d209ad9404ef51ac8b3288166947f95a2714862 100644 (file)
@@ -16,7 +16,6 @@
 #include "plpgsql.h"
 #include "pl.tab.h"
 
-#include "access/heapam.h"
 #include "catalog/pg_proc.h"
 #include "catalog/pg_type.h"
 #include "funcapi.h"
index 5dbad821149df64a03197f5f8bbb39b8338b076f..54771cbb95244f2c2c5e198cde2d6a9491144655 100644 (file)
@@ -48,7 +48,6 @@ typedef int Py_ssize_t;
 #include <fcntl.h>
 
 /* postgreSQL stuff */
-#include "access/heapam.h"
 #include "catalog/pg_proc.h"
 #include "catalog/pg_type.h"
 #include "commands/trigger.h"
index 5420722381cc77e26786694275ea2a0fa637765c..e41b0e2de4fe5857e0a21db3aa8035c544c592e1 100644 (file)
@@ -18,7 +18,6 @@
 #define CONST84
 #endif
 
-#include "access/heapam.h"
 #include "catalog/pg_language.h"
 #include "catalog/pg_proc.h"
 #include "commands/trigger.h"