*** a/contrib/auto_explain/auto_explain.c
--- b/contrib/auto_explain/auto_explain.c
***************
*** 12,17 ****
--- 12,19 ----
   */
  #include "postgres.h"
  
+ #include <limits.h>
+ 
  #include "commands/explain.h"
  #include "executor/instrument.h"
  #include "utils/guc.h"
*** a/contrib/dblink/dblink.c
--- b/contrib/dblink/dblink.c
***************
*** 34,39 ****
--- 34,40 ----
  
  #include <limits.h>
  
+ #include "access/htup.h"
  #include "libpq-fe.h"
  #include "funcapi.h"
  #include "catalog/indexing.h"
*** a/contrib/file_fdw/file_fdw.c
--- b/contrib/file_fdw/file_fdw.c
***************
*** 15,20 ****
--- 15,21 ----
  #include <sys/stat.h>
  #include <unistd.h>
  
+ #include "access/htup.h"
  #include "access/reloptions.h"
  #include "access/sysattr.h"
  #include "catalog/pg_foreign_table.h"
*** a/contrib/hstore/hstore_io.c
--- b/contrib/hstore/hstore_io.c
***************
*** 5,10 ****
--- 5,11 ----
  
  #include <ctype.h>
  
+ #include "access/htup.h"
  #include "catalog/pg_type.h"
  #include "funcapi.h"
  #include "libpq/pqformat.h"
*** a/contrib/hstore/hstore_op.c
--- b/contrib/hstore/hstore_op.c
***************
*** 4,9 ****
--- 4,10 ----
  #include "postgres.h"
  
  #include "access/hash.h"
+ #include "access/htup.h"
  #include "catalog/pg_type.h"
  #include "funcapi.h"
  #include "utils/builtins.h"
*** a/contrib/ltree/ltree_op.c
--- b/contrib/ltree/ltree_op.c
***************
*** 7,12 ****
--- 7,13 ----
  
  #include <ctype.h>
  
+ #include "access/htup.h"
  #include "catalog/pg_statistic.h"
  #include "utils/builtins.h"
  #include "utils/lsyscache.h"
*** a/contrib/pageinspect/heapfuncs.c
--- b/contrib/pageinspect/heapfuncs.c
***************
*** 25,33 ****
  
  #include "postgres.h"
  
  #include "funcapi.h"
- #include "utils/builtins.h"
  #include "miscadmin.h"
  
  Datum		heap_page_items(PG_FUNCTION_ARGS);
  
--- 25,34 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "funcapi.h"
  #include "miscadmin.h"
+ #include "utils/builtins.h"
  
  Datum		heap_page_items(PG_FUNCTION_ARGS);
  
*** a/contrib/pageinspect/rawpage.c
--- b/contrib/pageinspect/rawpage.c
***************
*** 15,20 ****
--- 15,21 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/catalog.h"
  #include "catalog/namespace.h"
  #include "funcapi.h"
*** a/contrib/pg_buffercache/pg_buffercache_pages.c
--- b/contrib/pg_buffercache/pg_buffercache_pages.c
***************
*** 8,13 ****
--- 8,14 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_type.h"
  #include "funcapi.h"
  #include "storage/buf_internals.h"
*** a/contrib/tablefunc/tablefunc.c
--- b/contrib/tablefunc/tablefunc.c
***************
*** 34,39 ****
--- 34,40 ----
  
  #include <math.h>
  
+ #include "access/htup.h"
  #include "catalog/pg_type.h"
  #include "funcapi.h"
  #include "executor/spi.h"
*** a/contrib/tcn/tcn.c
--- b/contrib/tcn/tcn.c
***************
*** 15,20 ****
--- 15,21 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "executor/spi.h"
  #include "commands/async.h"
  #include "commands/trigger.h"
*** a/contrib/xml2/xpath.c
--- b/contrib/xml2/xpath.c
***************
*** 6,11 ****
--- 6,12 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "executor/spi.h"
  #include "fmgr.h"
  #include "funcapi.h"
*** a/src/backend/access/common/printtup.c
--- b/src/backend/access/common/printtup.c
***************
*** 16,21 ****
--- 16,22 ----
  #include "postgres.h"
  
  #include "access/printtup.h"
+ #include "fmgr.h"
  #include "libpq/libpq.h"
  #include "libpq/pqformat.h"
  #include "tcop/pquery.h"
*** a/src/backend/access/common/reloptions.c
--- b/src/backend/access/common/reloptions.c
***************
*** 17,22 ****
--- 17,23 ----
  
  #include "access/gist_private.h"
  #include "access/hash.h"
+ #include "access/htup.h"
  #include "access/nbtree.h"
  #include "access/reloptions.h"
  #include "access/spgist.h"
*** a/src/backend/access/common/tupconvert.c
--- b/src/backend/access/common/tupconvert.c
***************
*** 21,26 ****
--- 21,27 ----
  #include "postgres.h"
  
  #include "access/tupconvert.h"
+ #include "access/htup.h"
  #include "utils/builtins.h"
  
  
*** a/src/backend/access/common/tupdesc.c
--- b/src/backend/access/common/tupdesc.c
***************
*** 19,30 ****
  
  #include "postgres.h"
  
  #include "catalog/pg_type.h"
  #include "miscadmin.h"
  #include "parser/parse_type.h"
  #include "utils/acl.h"
  #include "utils/builtins.h"
! #include "utils/resowner.h"
  #include "utils/syscache.h"
  
  
--- 19,31 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_type.h"
  #include "miscadmin.h"
  #include "parser/parse_type.h"
  #include "utils/acl.h"
  #include "utils/builtins.h"
! #include "utils/resowner_private.h"
  #include "utils/syscache.h"
  
  
*** a/src/backend/access/gin/gininsert.c
--- b/src/backend/access/gin/gininsert.c
***************
*** 15,20 ****
--- 15,22 ----
  #include "postgres.h"
  
  #include "access/gin_private.h"
+ #include "access/heapam_xlog.h"
+ #include "access/htup.h"
  #include "catalog/index.h"
  #include "miscadmin.h"
  #include "storage/bufmgr.h"
*** a/src/backend/access/gist/gistbuild.c
--- b/src/backend/access/gist/gistbuild.c
***************
*** 18,23 ****
--- 18,24 ----
  
  #include "access/genam.h"
  #include "access/gist_private.h"
+ #include "access/htup.h"
  #include "catalog/index.h"
  #include "miscadmin.h"
  #include "optimizer/cost.h"
*** a/src/backend/access/heap/heapam.c
--- b/src/backend/access/heap/heapam.c
***************
*** 40,46 ****
   */
  #include "postgres.h"
  
! #include "access/heapam.h"
  #include "access/hio.h"
  #include "access/multixact.h"
  #include "access/relscan.h"
--- 40,46 ----
   */
  #include "postgres.h"
  
! #include "access/heapam_xlog.h"
  #include "access/hio.h"
  #include "access/multixact.h"
  #include "access/relscan.h"
*** a/src/backend/access/heap/hio.c
--- b/src/backend/access/heap/hio.c
***************
*** 17,22 ****
--- 17,23 ----
  
  #include "access/heapam.h"
  #include "access/hio.h"
+ #include "access/htup.h"
  #include "access/visibilitymap.h"
  #include "storage/bufmgr.h"
  #include "storage/freespace.h"
*** a/src/backend/access/heap/pruneheap.c
--- b/src/backend/access/heap/pruneheap.c
***************
*** 15,20 ****
--- 15,22 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/heapam_xlog.h"
+ #include "access/htup.h"
  #include "access/transam.h"
  #include "miscadmin.h"
  #include "pgstat.h"
*** a/src/backend/access/heap/rewriteheap.c
--- b/src/backend/access/heap/rewriteheap.c
***************
*** 103,108 ****
--- 103,109 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/heapam_xlog.h"
  #include "access/rewriteheap.h"
  #include "access/transam.h"
  #include "access/tuptoaster.h"
*** a/src/backend/access/heap/visibilitymap.c
--- b/src/backend/access/heap/visibilitymap.c
***************
*** 83,88 ****
--- 83,89 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/heapam_xlog.h"
  #include "access/visibilitymap.h"
  #include "miscadmin.h"
  #include "storage/bufmgr.h"
*** a/src/backend/access/nbtree/nbtree.c
--- b/src/backend/access/nbtree/nbtree.c
***************
*** 18,23 ****
--- 18,24 ----
   */
  #include "postgres.h"
  
+ #include "access/heapam_xlog.h"
  #include "access/nbtree.h"
  #include "access/relscan.h"
  #include "catalog/index.h"
*** a/src/backend/access/nbtree/nbtsort.c
--- b/src/backend/access/nbtree/nbtsort.c
***************
*** 66,71 ****
--- 66,72 ----
  
  #include "postgres.h"
  
+ #include "access/heapam_xlog.h"
  #include "access/nbtree.h"
  #include "miscadmin.h"
  #include "storage/smgr.h"
*** a/src/backend/access/nbtree/nbtxlog.c
--- b/src/backend/access/nbtree/nbtxlog.c
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/heapam_xlog.h"
  #include "access/nbtree.h"
  #include "access/transam.h"
  #include "storage/procarray.h"
*** a/src/backend/access/spgist/spginsert.c
--- b/src/backend/access/spgist/spginsert.c
***************
*** 17,22 ****
--- 17,24 ----
  #include "postgres.h"
  
  #include "access/genam.h"
+ #include "access/heapam_xlog.h"
+ #include "access/htup.h"
  #include "access/spgist_private.h"
  #include "catalog/index.h"
  #include "miscadmin.h"
*** a/src/backend/access/transam/rmgr.c
--- b/src/backend/access/transam/rmgr.c
***************
*** 11,17 ****
  #include "access/gin.h"
  #include "access/gist_private.h"
  #include "access/hash.h"
! #include "access/heapam.h"
  #include "access/multixact.h"
  #include "access/nbtree.h"
  #include "access/spgist.h"
--- 11,17 ----
  #include "access/gin.h"
  #include "access/gist_private.h"
  #include "access/hash.h"
! #include "access/heapam_xlog.h"
  #include "access/multixact.h"
  #include "access/nbtree.h"
  #include "access/spgist.h"
*** a/src/backend/access/transam/xact.c
--- b/src/backend/access/transam/xact.c
***************
*** 38,49 ****
--- 38,51 ----
  #include "pgstat.h"
  #include "replication/walsender.h"
  #include "replication/syncrep.h"
+ #include "storage/fd.h"
  #include "storage/lmgr.h"
  #include "storage/predicate.h"
  #include "storage/proc.h"
  #include "storage/procarray.h"
  #include "storage/sinvaladt.h"
  #include "storage/smgr.h"
+ #include "utils/catcache.h"
  #include "utils/combocid.h"
  #include "utils/guc.h"
  #include "utils/inval.h"
*** a/src/backend/access/transam/xlogfuncs.c
--- b/src/backend/access/transam/xlogfuncs.c
***************
*** 16,21 ****
--- 16,22 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/xlog.h"
  #include "access/xlog_internal.h"
  #include "access/xlogutils.h"
*** a/src/backend/bootstrap/bootstrap.c
--- b/src/backend/bootstrap/bootstrap.c
***************
*** 21,26 ****
--- 21,27 ----
  #include <getopt.h>
  #endif
  
+ #include "access/htup.h"
  #include "bootstrap/bootstrap.h"
  #include "catalog/index.h"
  #include "catalog/pg_collation.h"
*** a/src/backend/catalog/aclchk.c
--- b/src/backend/catalog/aclchk.c
***************
*** 19,24 ****
--- 19,25 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "access/xact.h"
  #include "catalog/catalog.h"
*** a/src/backend/catalog/dependency.c
--- b/src/backend/catalog/dependency.c
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "access/xact.h"
  #include "catalog/dependency.h"
*** a/src/backend/catalog/heap.c
--- b/src/backend/catalog/heap.c
***************
*** 29,34 ****
--- 29,35 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "access/transam.h"
  #include "access/xact.h"
*** a/src/backend/catalog/indexing.c
--- b/src/backend/catalog/indexing.c
***************
*** 15,20 ****
--- 15,21 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/index.h"
  #include "catalog/indexing.h"
  #include "executor/executor.h"
*** a/src/backend/catalog/namespace.c
--- b/src/backend/catalog/namespace.c
***************
*** 19,24 ****
--- 19,25 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/dependency.h"
  #include "catalog/pg_authid.h"
***************
*** 46,51 ****
--- 47,53 ----
  #include "storage/sinval.h"
  #include "utils/acl.h"
  #include "utils/builtins.h"
+ #include "utils/catcache.h"
  #include "utils/guc.h"
  #include "utils/inval.h"
  #include "utils/lsyscache.h"
*** a/src/backend/catalog/objectaddress.c
--- b/src/backend/catalog/objectaddress.c
***************
*** 15,20 ****
--- 15,22 ----
  
  #include "postgres.h"
  
+ #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "catalog/catalog.h"
  #include "catalog/indexing.h"
*** a/src/backend/catalog/pg_aggregate.c
--- b/src/backend/catalog/pg_aggregate.c
***************
*** 15,20 ****
--- 15,21 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
  #include "catalog/pg_aggregate.h"
*** a/src/backend/catalog/pg_collation.c
--- b/src/backend/catalog/pg_collation.c
***************
*** 16,21 ****
--- 16,22 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
*** a/src/backend/catalog/pg_constraint.c
--- b/src/backend/catalog/pg_constraint.c
***************
*** 16,21 ****
--- 16,22 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
  #include "catalog/objectaccess.h"
*** a/src/backend/catalog/pg_conversion.c
--- b/src/backend/catalog/pg_conversion.c
***************
*** 15,20 ****
--- 15,21 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
***************
*** 25,30 ****
--- 26,32 ----
  #include "catalog/pg_proc.h"
  #include "mb/pg_wchar.h"
  #include "utils/builtins.h"
+ #include "utils/catcache.h"
  #include "utils/fmgroids.h"
  #include "utils/rel.h"
  #include "utils/syscache.h"
*** a/src/backend/catalog/pg_db_role_setting.c
--- b/src/backend/catalog/pg_db_role_setting.c
***************
*** 10,15 ****
--- 10,16 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/genam.h"
  #include "access/heapam.h"
  #include "catalog/indexing.h"
*** a/src/backend/catalog/pg_depend.c
--- b/src/backend/catalog/pg_depend.c
***************
*** 16,21 ****
--- 16,22 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
  #include "catalog/pg_constraint.h"
*** a/src/backend/catalog/pg_enum.c
--- b/src/backend/catalog/pg_enum.c
***************
*** 15,20 ****
--- 15,21 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/catalog.h"
  #include "catalog/indexing.h"
***************
*** 23,28 ****
--- 24,30 ----
  #include "storage/lmgr.h"
  #include "miscadmin.h"
  #include "utils/builtins.h"
+ #include "utils/catcache.h"
  #include "utils/fmgroids.h"
  #include "utils/syscache.h"
  #include "utils/tqual.h"
*** a/src/backend/catalog/pg_inherits.c
--- b/src/backend/catalog/pg_inherits.c
***************
*** 21,26 ****
--- 21,27 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/indexing.h"
  #include "catalog/pg_inherits.h"
  #include "catalog/pg_inherits_fn.h"
*** a/src/backend/catalog/pg_largeobject.c
--- b/src/backend/catalog/pg_largeobject.c
***************
*** 16,21 ****
--- 16,22 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
*** a/src/backend/catalog/pg_namespace.c
--- b/src/backend/catalog/pg_namespace.c
***************
*** 15,20 ****
--- 15,21 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
  #include "catalog/objectaccess.h"
*** a/src/backend/catalog/pg_operator.c
--- b/src/backend/catalog/pg_operator.c
***************
*** 18,23 ****
--- 18,24 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
*** a/src/backend/catalog/pg_proc.c
--- b/src/backend/catalog/pg_proc.c
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
*** a/src/backend/catalog/pg_range.c
--- b/src/backend/catalog/pg_range.c
***************
*** 16,21 ****
--- 16,22 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
  #include "catalog/pg_collation.h"
*** a/src/backend/catalog/pg_shdepend.c
--- b/src/backend/catalog/pg_shdepend.c
***************
*** 16,21 ****
--- 16,22 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/catalog.h"
  #include "catalog/dependency.h"
*** a/src/backend/catalog/pg_type.c
--- b/src/backend/catalog/pg_type.c
***************
*** 15,20 ****
--- 15,21 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
*** a/src/backend/commands/aggregatecmds.c
--- b/src/backend/commands/aggregatecmds.c
***************
*** 22,27 ****
--- 22,28 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/heapam.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
*** a/src/backend/commands/alter.c
--- b/src/backend/commands/alter.c
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
  #include "catalog/namespace.h"
*** a/src/backend/commands/collationcmds.c
--- b/src/backend/commands/collationcmds.c
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/heapam.h"
  #include "access/xact.h"
  #include "catalog/dependency.h"
*** a/src/backend/commands/comment.c
--- b/src/backend/commands/comment.c
***************
*** 16,21 ****
--- 16,22 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/indexing.h"
  #include "catalog/objectaddress.h"
  #include "catalog/pg_description.h"
*** a/src/backend/commands/constraint.c
--- b/src/backend/commands/constraint.c
***************
*** 13,18 ****
--- 13,19 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/index.h"
  #include "commands/trigger.h"
  #include "executor/executor.h"
*** a/src/backend/commands/conversioncmds.c
--- b/src/backend/commands/conversioncmds.c
***************
*** 15,20 ****
--- 15,21 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
  #include "catalog/pg_conversion.h"
*** a/src/backend/commands/copy.c
--- b/src/backend/commands/copy.c
***************
*** 21,26 ****
--- 21,27 ----
  #include <arpa/inet.h>
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "access/xact.h"
  #include "catalog/namespace.h"
*** a/src/backend/commands/createas.c
--- b/src/backend/commands/createas.c
***************
*** 21,26 ****
--- 21,27 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/reloptions.h"
  #include "access/sysattr.h"
  #include "access/xact.h"
*** a/src/backend/commands/dbcommands.c
--- b/src/backend/commands/dbcommands.c
***************
*** 26,31 ****
--- 26,32 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "access/xlogutils.h"
  #include "catalog/catalog.h"
***************
*** 45,50 ****
--- 46,52 ----
  #include "pgstat.h"
  #include "postmaster/bgwriter.h"
  #include "storage/copydir.h"
+ #include "storage/fd.h"
  #include "storage/lmgr.h"
  #include "storage/ipc.h"
  #include "storage/procarray.h"
*** a/src/backend/commands/dropcmds.c
--- b/src/backend/commands/dropcmds.c
***************
*** 16,21 ****
--- 16,22 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/dependency.h"
  #include "catalog/namespace.h"
  #include "catalog/objectaddress.h"
*** a/src/backend/commands/event_trigger.c
--- b/src/backend/commands/event_trigger.c
***************
*** 13,18 ****
--- 13,19 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
*** a/src/backend/commands/extension.c
--- b/src/backend/commands/extension.c
***************
*** 27,32 ****
--- 27,33 ----
  #include <limits.h>
  #include <unistd.h>
  
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "access/xact.h"
  #include "catalog/dependency.h"
***************
*** 45,50 ****
--- 46,52 ----
  #include "funcapi.h"
  #include "mb/pg_wchar.h"
  #include "miscadmin.h"
+ #include "storage/fd.h"
  #include "tcop/utility.h"
  #include "utils/builtins.h"
  #include "utils/fmgroids.h"
*** a/src/backend/commands/foreigncmds.c
--- b/src/backend/commands/foreigncmds.c
***************
*** 14,19 ****
--- 14,20 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "access/reloptions.h"
  #include "catalog/dependency.h"
*** a/src/backend/commands/functioncmds.c
--- b/src/backend/commands/functioncmds.c
***************
*** 33,38 ****
--- 33,39 ----
  #include "postgres.h"
  
  #include "access/genam.h"
+ #include "access/htup.h"
  #include "access/heapam.h"
  #include "access/sysattr.h"
  #include "catalog/dependency.h"
*** a/src/backend/commands/indexcmds.c
--- b/src/backend/commands/indexcmds.c
***************
*** 15,20 ****
--- 15,21 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/reloptions.h"
  #include "access/xact.h"
  #include "catalog/catalog.h"
*** a/src/backend/commands/opclasscmds.c
--- b/src/backend/commands/opclasscmds.c
***************
*** 19,24 ****
--- 19,25 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/nbtree.h"
  #include "access/sysattr.h"
  #include "catalog/dependency.h"
*** a/src/backend/commands/operatorcmds.c
--- b/src/backend/commands/operatorcmds.c
***************
*** 35,40 ****
--- 35,41 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
  #include "catalog/pg_operator.h"
*** a/src/backend/commands/proclang.c
--- b/src/backend/commands/proclang.c
***************
*** 15,20 ****
--- 15,21 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
  #include "catalog/objectaccess.h"
*** a/src/backend/commands/schemacmds.c
--- b/src/backend/commands/schemacmds.c
***************
*** 14,19 ****
--- 14,21 ----
   */
  #include "postgres.h"
  
+ #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/catalog.h"
  #include "catalog/dependency.h"
*** a/src/backend/commands/seclabel.c
--- b/src/backend/commands/seclabel.c
***************
*** 12,17 ****
--- 12,18 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/catalog.h"
  #include "catalog/indexing.h"
  #include "catalog/pg_seclabel.h"
*** a/src/backend/commands/sequence.c
--- b/src/backend/commands/sequence.c
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/transam.h"
  #include "access/xlogutils.h"
  #include "catalog/dependency.h"
*** a/src/backend/commands/tablecmds.c
--- b/src/backend/commands/tablecmds.c
***************
*** 15,21 ****
  #include "postgres.h"
  
  #include "access/genam.h"
! #include "access/heapam.h"
  #include "access/reloptions.h"
  #include "access/relscan.h"
  #include "access/sysattr.h"
--- 15,21 ----
  #include "postgres.h"
  
  #include "access/genam.h"
! #include "access/heapam_xlog.h"
  #include "access/reloptions.h"
  #include "access/relscan.h"
  #include "access/sysattr.h"
*** a/src/backend/commands/tablespace.c
--- b/src/backend/commands/tablespace.c
***************
*** 52,57 ****
--- 52,58 ----
  #include <sys/stat.h>
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/reloptions.h"
  #include "access/sysattr.h"
  #include "access/xact.h"
*** a/src/backend/commands/trigger.c
--- b/src/backend/commands/trigger.c
***************
*** 15,20 ****
--- 15,21 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "access/xact.h"
  #include "catalog/catalog.h"
*** a/src/backend/commands/tsearchcmds.c
--- b/src/backend/commands/tsearchcmds.c
***************
*** 17,24 ****
  
  #include <ctype.h>
  
- #include "access/heapam.h"
  #include "access/genam.h"
  #include "access/xact.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
--- 17,25 ----
  
  #include <ctype.h>
  
  #include "access/genam.h"
+ #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
*** a/src/backend/commands/typecmds.c
--- b/src/backend/commands/typecmds.c
***************
*** 33,38 ****
--- 33,39 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/catalog.h"
  #include "catalog/dependency.h"
*** a/src/backend/commands/user.c
--- b/src/backend/commands/user.c
***************
*** 14,19 ****
--- 14,20 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
*** a/src/backend/commands/vacuum.c
--- b/src/backend/commands/vacuum.c
***************
*** 25,30 ****
--- 25,31 ----
  #include "access/clog.h"
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/transam.h"
  #include "access/xact.h"
  #include "catalog/namespace.h"
*** a/src/backend/commands/vacuumlazy.c
--- b/src/backend/commands/vacuumlazy.c
***************
*** 39,44 ****
--- 39,46 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/heapam_xlog.h"
+ #include "access/htup.h"
  #include "access/transam.h"
  #include "access/visibilitymap.h"
  #include "catalog/storage.h"
*** a/src/backend/commands/variable.c
--- b/src/backend/commands/variable.c
***************
*** 18,23 ****
--- 18,24 ----
  
  #include <ctype.h>
  
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/pg_authid.h"
  #include "commands/variable.h"
*** a/src/backend/executor/execAmi.c
--- b/src/backend/executor/execAmi.c
***************
*** 12,17 ****
--- 12,18 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "executor/execdebug.h"
  #include "executor/nodeAgg.h"
  #include "executor/nodeAppend.h"
*** a/src/backend/executor/execMain.c
--- b/src/backend/executor/execMain.c
***************
*** 37,42 ****
--- 37,44 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
+ #include "access/reloptions.h"
  #include "access/sysattr.h"
  #include "access/transam.h"
  #include "access/xact.h"
*** a/src/backend/executor/execQual.c
--- b/src/backend/executor/execQual.c
***************
*** 36,41 ****
--- 36,42 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/nbtree.h"
  #include "access/tupconvert.h"
  #include "catalog/pg_type.h"
*** a/src/backend/executor/execTuples.c
--- b/src/backend/executor/execTuples.c
***************
*** 88,95 ****
   */
  #include "postgres.h"
  
! #include "funcapi.h"
  #include "catalog/pg_type.h"
  #include "nodes/nodeFuncs.h"
  #include "storage/bufmgr.h"
  #include "utils/builtins.h"
--- 88,96 ----
   */
  #include "postgres.h"
  
! #include "access/htup.h"
  #include "catalog/pg_type.h"
+ #include "funcapi.h"
  #include "nodes/nodeFuncs.h"
  #include "storage/bufmgr.h"
  #include "utils/builtins.h"
*** a/src/backend/executor/functions.c
--- b/src/backend/executor/functions.c
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/pg_proc.h"
  #include "catalog/pg_type.h"
*** a/src/backend/executor/nodeAgg.c
--- b/src/backend/executor/nodeAgg.c
***************
*** 78,83 ****
--- 78,84 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_aggregate.h"
  #include "catalog/pg_proc.h"
  #include "catalog/pg_type.h"
*** a/src/backend/executor/nodeHash.c
--- b/src/backend/executor/nodeHash.c
***************
*** 24,29 ****
--- 24,30 ----
  #include <math.h>
  #include <limits.h>
  
+ #include "access/htup.h"
  #include "catalog/pg_statistic.h"
  #include "commands/tablespace.h"
  #include "executor/execdebug.h"
*** a/src/backend/executor/nodeHashjoin.c
--- b/src/backend/executor/nodeHashjoin.c
***************
*** 15,20 ****
--- 15,21 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "executor/executor.h"
  #include "executor/hashjoin.h"
  #include "executor/nodeHash.h"
*** a/src/backend/executor/nodeLockRows.c
--- b/src/backend/executor/nodeLockRows.c
***************
*** 21,26 ****
--- 21,27 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "executor/executor.h"
  #include "executor/nodeLockRows.h"
*** a/src/backend/executor/nodeModifyTable.c
--- b/src/backend/executor/nodeModifyTable.c
***************
*** 37,42 ****
--- 37,43 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "commands/trigger.h"
  #include "executor/executor.h"
*** a/src/backend/executor/nodeSetOp.c
--- b/src/backend/executor/nodeSetOp.c
***************
*** 44,49 ****
--- 44,50 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "executor/executor.h"
  #include "executor/nodeSetOp.h"
  #include "utils/memutils.h"
*** a/src/backend/executor/nodeSubplan.c
--- b/src/backend/executor/nodeSubplan.c
***************
*** 18,25 ****
--- 18,27 ----
   */
  #include "postgres.h"
  
+ #include <limits.h>
  #include <math.h>
  
+ #include "access/htup.h"
  #include "executor/executor.h"
  #include "executor/nodeSubplan.h"
  #include "nodes/makefuncs.h"
*** a/src/backend/executor/nodeWindowAgg.c
--- b/src/backend/executor/nodeWindowAgg.c
***************
*** 33,38 ****
--- 33,39 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_aggregate.h"
  #include "catalog/pg_proc.h"
  #include "catalog/pg_type.h"
*** a/src/backend/executor/spi.c
--- b/src/backend/executor/spi.c
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/printtup.h"
  #include "access/sysattr.h"
  #include "access/xact.h"
*** a/src/backend/foreign/foreign.c
--- b/src/backend/foreign/foreign.c
***************
*** 12,17 ****
--- 12,18 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/reloptions.h"
  #include "catalog/pg_foreign_data_wrapper.h"
  #include "catalog/pg_foreign_server.h"
*** a/src/backend/nodes/print.c
--- b/src/backend/nodes/print.c
***************
*** 20,25 ****
--- 20,26 ----
  #include "postgres.h"
  
  #include "access/printtup.h"
+ #include "fmgr.h"
  #include "nodes/print.h"
  #include "optimizer/clauses.h"
  #include "parser/parsetree.h"
*** a/src/backend/optimizer/path/costsize.c
--- b/src/backend/optimizer/path/costsize.c
***************
*** 70,75 ****
--- 70,76 ----
  
  #include <math.h>
  
+ #include "access/htup.h"
  #include "executor/executor.h"
  #include "executor/nodeHash.h"
  #include "miscadmin.h"
*** a/src/backend/optimizer/plan/planagg.c
--- b/src/backend/optimizer/plan/planagg.c
***************
*** 28,33 ****
--- 28,34 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_aggregate.h"
  #include "catalog/pg_type.h"
  #include "nodes/makefuncs.h"
*** a/src/backend/optimizer/plan/planner.c
--- b/src/backend/optimizer/plan/planner.c
***************
*** 17,22 ****
--- 17,23 ----
  
  #include <limits.h>
  
+ #include "access/htup.h"
  #include "executor/executor.h"
  #include "executor/nodeAgg.h"
  #include "miscadmin.h"
*** a/src/backend/optimizer/plan/subselect.c
--- b/src/backend/optimizer/plan/subselect.c
***************
*** 13,18 ****
--- 13,19 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_operator.h"
  #include "catalog/pg_type.h"
  #include "executor/executor.h"
*** a/src/backend/optimizer/prep/prepunion.c
--- b/src/backend/optimizer/prep/prepunion.c
***************
*** 28,35 ****
--- 28,37 ----
   */
  #include "postgres.h"
  
+ #include <limits.h>
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "catalog/pg_inherits_fn.h"
  #include "catalog/pg_type.h"
*** a/src/backend/optimizer/util/clauses.c
--- b/src/backend/optimizer/util/clauses.c
***************
*** 19,24 ****
--- 19,25 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_aggregate.h"
  #include "catalog/pg_language.h"
  #include "catalog/pg_operator.h"
*** a/src/backend/optimizer/util/plancat.c
--- b/src/backend/optimizer/util/plancat.c
***************
*** 19,26 ****
--- 19,28 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "access/transam.h"
+ #include "access/xlog.h"
  #include "catalog/catalog.h"
  #include "catalog/heap.h"
  #include "miscadmin.h"
*** a/src/backend/parser/parse_coerce.c
--- b/src/backend/parser/parse_coerce.c
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_cast.h"
  #include "catalog/pg_class.h"
  #include "catalog/pg_inherits_fn.h"
*** a/src/backend/parser/parse_func.c
--- b/src/backend/parser/parse_func.c
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_proc.h"
  #include "catalog/pg_type.h"
  #include "funcapi.h"
*** a/src/backend/parser/parse_node.c
--- b/src/backend/parser/parse_node.c
***************
*** 15,20 ****
--- 15,21 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/pg_type.h"
  #include "mb/pg_wchar.h"
  #include "nodes/makefuncs.h"
*** a/src/backend/parser/parse_oper.c
--- b/src/backend/parser/parse_oper.c
***************
*** 15,20 ****
--- 15,21 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_operator.h"
  #include "catalog/pg_type.h"
  #include "lib/stringinfo.h"
*** a/src/backend/parser/parse_relation.c
--- b/src/backend/parser/parse_relation.c
***************
*** 16,21 ****
--- 16,22 ----
  
  #include <ctype.h>
  
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "catalog/heap.h"
  #include "catalog/namespace.h"
*** a/src/backend/parser/parse_type.c
--- b/src/backend/parser/parse_type.c
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/namespace.h"
  #include "catalog/pg_type.h"
  #include "lib/stringinfo.h"
*** a/src/backend/parser/parse_utilcmd.c
--- b/src/backend/parser/parse_utilcmd.c
***************
*** 26,31 ****
--- 26,32 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/reloptions.h"
  #include "catalog/dependency.h"
  #include "catalog/heap.h"
*** a/src/backend/postmaster/autovacuum.c
--- b/src/backend/postmaster/autovacuum.c
***************
*** 68,73 ****
--- 68,74 ----
  #include <unistd.h>
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/reloptions.h"
  #include "access/transam.h"
  #include "access/xact.h"
***************
*** 76,81 ****
--- 77,83 ----
  #include "catalog/pg_database.h"
  #include "commands/dbcommands.h"
  #include "commands/vacuum.h"
+ #include "lib/dllist.h"
  #include "libpq/pqsignal.h"
  #include "miscadmin.h"
  #include "pgstat.h"
*** a/src/backend/postmaster/bgwriter.c
--- b/src/backend/postmaster/bgwriter.c
***************
*** 46,51 ****
--- 46,52 ----
  #include "postmaster/bgwriter.h"
  #include "storage/bufmgr.h"
  #include "storage/buf_internals.h"
+ #include "storage/fd.h"
  #include "storage/ipc.h"
  #include "storage/lwlock.h"
  #include "storage/proc.h"
*** a/src/backend/postmaster/checkpointer.c
--- b/src/backend/postmaster/checkpointer.c
***************
*** 48,53 ****
--- 48,54 ----
  #include "postmaster/bgwriter.h"
  #include "replication/syncrep.h"
  #include "storage/bufmgr.h"
+ #include "storage/fd.h"
  #include "storage/ipc.h"
  #include "storage/lwlock.h"
  #include "storage/proc.h"
*** a/src/backend/postmaster/pgstat.c
--- b/src/backend/postmaster/pgstat.c
***************
*** 32,37 ****
--- 32,38 ----
  #include "pgstat.h"
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/transam.h"
  #include "access/twophase_rmgr.h"
  #include "access/xact.h"
*** a/src/backend/postmaster/walwriter.c
--- b/src/backend/postmaster/walwriter.c
***************
*** 51,56 ****
--- 51,57 ----
  #include "miscadmin.h"
  #include "postmaster/walwriter.h"
  #include "storage/bufmgr.h"
+ #include "storage/fd.h"
  #include "storage/ipc.h"
  #include "storage/lwlock.h"
  #include "storage/proc.h"
*** a/src/backend/rewrite/rewriteDefine.c
--- b/src/backend/rewrite/rewriteDefine.c
***************
*** 15,20 ****
--- 15,21 ----
  #include "postgres.h"
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/catalog.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
*** a/src/backend/rewrite/rewriteRemove.c
--- b/src/backend/rewrite/rewriteRemove.c
***************
*** 16,21 ****
--- 16,22 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
*** a/src/backend/rewrite/rewriteSupport.c
--- b/src/backend/rewrite/rewriteSupport.c
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/heapam.h"
  #include "catalog/indexing.h"
  #include "catalog/pg_rewrite.h"
*** a/src/backend/storage/buffer/bufmgr.c
--- b/src/backend/storage/buffer/bufmgr.c
***************
*** 46,52 ****
  #include "storage/smgr.h"
  #include "storage/standby.h"
  #include "utils/rel.h"
! #include "utils/resowner.h"
  #include "utils/timestamp.h"
  
  
--- 46,52 ----
  #include "storage/smgr.h"
  #include "storage/standby.h"
  #include "utils/rel.h"
! #include "utils/resowner_private.h"
  #include "utils/timestamp.h"
  
  
*** a/src/backend/storage/buffer/localbuf.c
--- b/src/backend/storage/buffer/localbuf.c
***************
*** 21,27 ****
  #include "storage/bufmgr.h"
  #include "utils/guc.h"
  #include "utils/memutils.h"
! #include "utils/resowner.h"
  
  
  /*#define LBDEBUG*/
--- 21,27 ----
  #include "storage/bufmgr.h"
  #include "utils/guc.h"
  #include "utils/memutils.h"
! #include "utils/resowner_private.h"
  
  
  /*#define LBDEBUG*/
*** a/src/backend/storage/file/fd.c
--- b/src/backend/storage/file/fd.c
***************
*** 57,63 ****
  #include "storage/fd.h"
  #include "storage/ipc.h"
  #include "utils/guc.h"
! #include "utils/resowner.h"
  
  
  /*
--- 57,63 ----
  #include "storage/fd.h"
  #include "storage/ipc.h"
  #include "utils/guc.h"
! #include "utils/resowner_private.h"
  
  
  /*
*** a/src/backend/storage/ipc/procsignal.c
--- b/src/backend/storage/ipc/procsignal.c
***************
*** 21,26 ****
--- 21,27 ----
  #include "miscadmin.h"
  #include "storage/latch.h"
  #include "storage/ipc.h"
+ #include "storage/shmem.h"
  #include "storage/sinval.h"
  #include "tcop/tcopprot.h"
  
*** a/src/backend/storage/lmgr/lock.c
--- b/src/backend/storage/lmgr/lock.c
***************
*** 44,50 ****
  #include "storage/standby.h"
  #include "utils/memutils.h"
  #include "utils/ps_status.h"
! #include "utils/resowner.h"
  
  
  /* This configuration variable is used to set the lock table size */
--- 44,50 ----
  #include "storage/standby.h"
  #include "utils/memutils.h"
  #include "utils/ps_status.h"
! #include "utils/resowner_private.h"
  
  
  /* This configuration variable is used to set the lock table size */
*** a/src/backend/storage/lmgr/predicate.c
--- b/src/backend/storage/lmgr/predicate.c
***************
*** 183,188 ****
--- 183,189 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/slru.h"
  #include "access/subtrans.h"
  #include "access/transam.h"
*** a/src/backend/tcop/fastpath.c
--- b/src/backend/tcop/fastpath.c
***************
*** 20,25 ****
--- 20,26 ----
  #include <netinet/in.h>
  #include <arpa/inet.h>
  
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/pg_proc.h"
  #include "libpq/libpq.h"
*** a/src/backend/tcop/utility.c
--- b/src/backend/tcop/utility.c
***************
*** 16,21 ****
--- 16,22 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/reloptions.h"
  #include "access/twophase.h"
  #include "access/xact.h"
*** a/src/backend/tsearch/ts_selfuncs.c
--- b/src/backend/tsearch/ts_selfuncs.c
***************
*** 13,18 ****
--- 13,19 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_statistic.h"
  #include "catalog/pg_type.h"
  #include "miscadmin.h"
*** a/src/backend/tsearch/wparser.c
--- b/src/backend/tsearch/wparser.c
***************
*** 13,18 ****
--- 13,19 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "funcapi.h"
  #include "catalog/namespace.h"
  #include "catalog/pg_type.h"
*** a/src/backend/utils/adt/acl.c
--- b/src/backend/utils/adt/acl.c
***************
*** 16,21 ****
--- 16,22 ----
  
  #include <ctype.h>
  
+ #include "access/htup.h"
  #include "catalog/namespace.h"
  #include "catalog/pg_authid.h"
  #include "catalog/pg_auth_members.h"
***************
*** 29,34 ****
--- 30,36 ----
  #include "miscadmin.h"
  #include "utils/acl.h"
  #include "utils/builtins.h"
+ #include "utils/catcache.h"
  #include "utils/inval.h"
  #include "utils/lsyscache.h"
  #include "utils/memutils.h"
*** a/src/backend/utils/adt/array_selfuncs.c
--- b/src/backend/utils/adt/array_selfuncs.c
***************
*** 16,21 ****
--- 16,22 ----
  
  #include <math.h>
  
+ #include "access/htup.h"
  #include "catalog/pg_collation.h"
  #include "catalog/pg_operator.h"
  #include "catalog/pg_statistic.h"
*** a/src/backend/utils/adt/arrayfuncs.c
--- b/src/backend/utils/adt/arrayfuncs.c
***************
*** 16,21 ****
--- 16,22 ----
  
  #include <ctype.h>
  
+ #include "access/htup.h"
  #include "funcapi.h"
  #include "libpq/pqformat.h"
  #include "utils/array.h"
*** a/src/backend/utils/adt/datetime.c
--- b/src/backend/utils/adt/datetime.c
***************
*** 19,24 ****
--- 19,26 ----
  #include <limits.h>
  #include <math.h>
  
+ #include "access/htup.h"
+ #include "access/heapam.h"
  #include "access/xact.h"
  #include "catalog/pg_type.h"
  #include "funcapi.h"
*** a/src/backend/utils/adt/dbsize.c
--- b/src/backend/utils/adt/dbsize.c
***************
*** 15,20 ****
--- 15,21 ----
  #include <sys/stat.h>
  
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/catalog.h"
  #include "catalog/namespace.h"
  #include "catalog/pg_tablespace.h"
*** a/src/backend/utils/adt/enum.c
--- b/src/backend/utils/adt/enum.c
***************
*** 15,20 ****
--- 15,21 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/indexing.h"
  #include "catalog/pg_enum.h"
  #include "libpq/pqformat.h"
*** a/src/backend/utils/adt/format_type.c
--- b/src/backend/utils/adt/format_type.c
***************
*** 17,22 ****
--- 17,23 ----
  
  #include <ctype.h>
  
+ #include "access/htup.h"
  #include "catalog/namespace.h"
  #include "catalog/pg_type.h"
  #include "utils/builtins.h"
*** a/src/backend/utils/adt/genfile.c
--- b/src/backend/utils/adt/genfile.c
***************
*** 20,25 ****
--- 20,26 ----
  #include <unistd.h>
  #include <dirent.h>
  
+ #include "access/htup.h"
  #include "catalog/pg_type.h"
  #include "funcapi.h"
  #include "mb/pg_wchar.h"
*** a/src/backend/utils/adt/json.c
--- b/src/backend/utils/adt/json.c
***************
*** 13,18 ****
--- 13,19 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_type.h"
  #include "executor/spi.h"
  #include "lib/stringinfo.h"
*** a/src/backend/utils/adt/lockfuncs.c
--- b/src/backend/utils/adt/lockfuncs.c
***************
*** 12,17 ****
--- 12,18 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_type.h"
  #include "funcapi.h"
  #include "miscadmin.h"
*** a/src/backend/utils/adt/pg_locale.c
--- b/src/backend/utils/adt/pg_locale.c
***************
*** 54,59 ****
--- 54,60 ----
  #include <locale.h>
  #include <time.h>
  
+ #include "access/htup.h"
  #include "catalog/pg_collation.h"
  #include "catalog/pg_control.h"
  #include "mb/pg_wchar.h"
*** a/src/backend/utils/adt/pgstatfuncs.c
--- b/src/backend/utils/adt/pgstatfuncs.c
***************
*** 14,19 ****
--- 14,20 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_type.h"
  #include "funcapi.h"
  #include "libpq/ip.h"
*** a/src/backend/utils/adt/rangetypes_selfuncs.c
--- b/src/backend/utils/adt/rangetypes_selfuncs.c
***************
*** 17,22 ****
--- 17,23 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_operator.h"
  #include "catalog/pg_statistic.h"
  #include "utils/lsyscache.h"
*** a/src/backend/utils/adt/regproc.c
--- b/src/backend/utils/adt/regproc.c
***************
*** 23,28 ****
--- 23,29 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/indexing.h"
  #include "catalog/namespace.h"
  #include "catalog/pg_class.h"
*** a/src/backend/utils/adt/ri_triggers.c
--- b/src/backend/utils/adt/ri_triggers.c
***************
*** 30,35 ****
--- 30,36 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "access/sysattr.h"
  #include "catalog/pg_collation.h"
*** a/src/backend/utils/adt/rowtypes.c
--- b/src/backend/utils/adt/rowtypes.c
***************
*** 16,21 ****
--- 16,22 ----
  
  #include <ctype.h>
  
+ #include "access/htup.h"
  #include "catalog/pg_type.h"
  #include "libpq/pqformat.h"
  #include "utils/builtins.h"
*** a/src/backend/utils/adt/ruleutils.c
--- b/src/backend/utils/adt/ruleutils.c
***************
*** 18,23 ****
--- 18,24 ----
  #include <unistd.h>
  #include <fcntl.h>
  
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "catalog/dependency.h"
  #include "catalog/indexing.h"
*** a/src/backend/utils/adt/selfuncs.c
--- b/src/backend/utils/adt/selfuncs.c
***************
*** 101,106 ****
--- 101,107 ----
  #include <math.h>
  
  #include "access/gin.h"
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "catalog/index.h"
  #include "catalog/pg_collation.h"
*** a/src/backend/utils/adt/trigfuncs.c
--- b/src/backend/utils/adt/trigfuncs.c
***************
*** 13,18 ****
--- 13,19 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "commands/trigger.h"
  #include "utils/builtins.h"
  #include "utils/rel.h"
*** a/src/backend/utils/adt/xml.c
--- b/src/backend/utils/adt/xml.c
***************
*** 67,72 ****
--- 67,73 ----
  #endif
  #endif   /* USE_LIBXML */
  
+ #include "access/htup.h"
  #include "catalog/namespace.h"
  #include "catalog/pg_type.h"
  #include "commands/dbcommands.h"
*** a/src/backend/utils/cache/attoptcache.c
--- b/src/backend/utils/cache/attoptcache.c
***************
*** 18,23 ****
--- 18,24 ----
  
  #include "access/reloptions.h"
  #include "utils/attoptcache.h"
+ #include "utils/catcache.h"
  #include "utils/hsearch.h"
  #include "utils/inval.h"
  #include "utils/syscache.h"
*** a/src/backend/utils/cache/catcache.c
--- b/src/backend/utils/cache/catcache.c
***************
*** 33,39 ****
  #include "utils/inval.h"
  #include "utils/memutils.h"
  #include "utils/rel.h"
! #include "utils/resowner.h"
  #include "utils/syscache.h"
  #include "utils/tqual.h"
  
--- 33,39 ----
  #include "utils/inval.h"
  #include "utils/memutils.h"
  #include "utils/rel.h"
! #include "utils/resowner_private.h"
  #include "utils/syscache.h"
  #include "utils/tqual.h"
  
*** a/src/backend/utils/cache/evtcache.c
--- b/src/backend/utils/cache/evtcache.c
***************
*** 15,26 ****
--- 15,28 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "catalog/pg_event_trigger.h"
  #include "catalog/indexing.h"
  #include "catalog/pg_type.h"
  #include "commands/trigger.h"
  #include "utils/array.h"
  #include "utils/builtins.h"
+ #include "utils/catcache.h"
  #include "utils/evtcache.h"
  #include "utils/inval.h"
  #include "utils/memutils.h"
*** a/src/backend/utils/cache/inval.c
--- b/src/backend/utils/cache/inval.c
***************
*** 95,105 ****
--- 95,107 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/catalog.h"
  #include "miscadmin.h"
  #include "storage/sinval.h"
  #include "storage/smgr.h"
+ #include "utils/catcache.h"
  #include "utils/inval.h"
  #include "utils/memutils.h"
  #include "utils/rel.h"
*** a/src/backend/utils/cache/lsyscache.c
--- b/src/backend/utils/cache/lsyscache.c
***************
*** 16,21 ****
--- 16,22 ----
  #include "postgres.h"
  
  #include "access/hash.h"
+ #include "access/htup.h"
  #include "access/nbtree.h"
  #include "bootstrap/bootstrap.h"
  #include "catalog/pg_amop.h"
***************
*** 33,38 ****
--- 34,40 ----
  #include "nodes/makefuncs.h"
  #include "utils/array.h"
  #include "utils/builtins.h"
+ #include "utils/catcache.h"
  #include "utils/datum.h"
  #include "utils/fmgroids.h"
  #include "utils/lsyscache.h"
*** a/src/backend/utils/cache/plancache.c
--- b/src/backend/utils/cache/plancache.c
***************
*** 61,66 ****
--- 61,67 ----
  #include "tcop/utility.h"
  #include "utils/inval.h"
  #include "utils/memutils.h"
+ #include "utils/resowner_private.h"
  #include "utils/snapmgr.h"
  #include "utils/syscache.h"
  
*** a/src/backend/utils/cache/relcache.c
--- b/src/backend/utils/cache/relcache.c
***************
*** 30,35 ****
--- 30,36 ----
  #include <fcntl.h>
  #include <unistd.h>
  
+ #include "access/htup.h"
  #include "access/reloptions.h"
  #include "access/sysattr.h"
  #include "access/transam.h"
***************
*** 69,75 ****
  #include "utils/lsyscache.h"
  #include "utils/memutils.h"
  #include "utils/relmapper.h"
! #include "utils/resowner.h"
  #include "utils/syscache.h"
  #include "utils/tqual.h"
  
--- 70,76 ----
  #include "utils/lsyscache.h"
  #include "utils/memutils.h"
  #include "utils/relmapper.h"
! #include "utils/resowner_private.h"
  #include "utils/syscache.h"
  #include "utils/tqual.h"
  
*** a/src/backend/utils/cache/spccache.c
--- b/src/backend/utils/cache/spccache.c
***************
*** 23,28 ****
--- 23,29 ----
  #include "commands/tablespace.h"
  #include "miscadmin.h"
  #include "optimizer/cost.h"
+ #include "utils/catcache.h"
  #include "utils/hsearch.h"
  #include "utils/inval.h"
  #include "utils/spccache.h"
*** a/src/backend/utils/cache/syscache.c
--- b/src/backend/utils/cache/syscache.c
***************
*** 20,25 ****
--- 20,26 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "catalog/indexing.h"
  #include "catalog/pg_aggregate.h"
***************
*** 56,61 ****
--- 57,63 ----
  #include "catalog/pg_type.h"
  #include "catalog/pg_user_mapping.h"
  #include "utils/rel.h"
+ #include "utils/catcache.h"
  #include "utils/syscache.h"
  
  
*** a/src/backend/utils/cache/ts_cache.c
--- b/src/backend/utils/cache/ts_cache.c
***************
*** 28,33 ****
--- 28,34 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/indexing.h"
  #include "catalog/namespace.h"
***************
*** 39,44 ****
--- 40,46 ----
  #include "commands/defrem.h"
  #include "tsearch/ts_cache.h"
  #include "utils/builtins.h"
+ #include "utils/catcache.h"
  #include "utils/fmgroids.h"
  #include "utils/inval.h"
  #include "utils/lsyscache.h"
*** a/src/backend/utils/cache/typcache.c
--- b/src/backend/utils/cache/typcache.c
***************
*** 47,52 ****
--- 47,53 ----
  
  #include "access/hash.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/nbtree.h"
  #include "catalog/indexing.h"
  #include "catalog/pg_enum.h"
***************
*** 55,60 ****
--- 56,62 ----
  #include "catalog/pg_type.h"
  #include "commands/defrem.h"
  #include "utils/builtins.h"
+ #include "utils/catcache.h"
  #include "utils/fmgroids.h"
  #include "utils/inval.h"
  #include "utils/lsyscache.h"
*** a/src/backend/utils/fmgr/funcapi.c
--- b/src/backend/utils/fmgr/funcapi.c
***************
*** 13,18 ****
--- 13,19 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/namespace.h"
  #include "catalog/pg_proc.h"
  #include "catalog/pg_type.h"
*** a/src/backend/utils/init/miscinit.c
--- b/src/backend/utils/init/miscinit.c
***************
*** 29,34 ****
--- 29,35 ----
  #include <utime.h>
  #endif
  
+ #include "access/htup.h"
  #include "catalog/pg_authid.h"
  #include "mb/pg_wchar.h"
  #include "miscadmin.h"
*** a/src/backend/utils/init/postinit.c
--- b/src/backend/utils/init/postinit.c
***************
*** 19,25 ****
--- 19,27 ----
  #include <fcntl.h>
  #include <unistd.h>
  
+ #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/sysattr.h"
  #include "access/xact.h"
  #include "catalog/catalog.h"
*** a/src/backend/utils/misc/superuser.c
--- b/src/backend/utils/misc/superuser.c
***************
*** 20,25 ****
--- 20,26 ----
   */
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_authid.h"
  #include "utils/inval.h"
  #include "utils/syscache.h"
*** a/src/backend/utils/mmgr/portalmem.c
--- b/src/backend/utils/mmgr/portalmem.c
***************
*** 22,28 ****
--- 22,30 ----
  #include "catalog/pg_type.h"
  #include "commands/portalcmds.h"
  #include "miscadmin.h"
+ #include "nodes/execnodes.h"
  #include "utils/builtins.h"
+ #include "utils/hsearch.h"
  #include "utils/memutils.h"
  #include "utils/timestamp.h"
  
*** a/src/backend/utils/resowner/resowner.c
--- b/src/backend/utils/resowner/resowner.c
***************
*** 25,30 ****
--- 25,31 ----
  #include "storage/proc.h"
  #include "utils/memutils.h"
  #include "utils/rel.h"
+ #include "utils/resowner_private.h"
  #include "utils/snapmgr.h"
  
  /*
*** a/src/backend/utils/sort/tuplesort.c
--- b/src/backend/utils/sort/tuplesort.c
***************
*** 100,105 ****
--- 100,106 ----
  
  #include <limits.h>
  
+ #include "access/htup.h"
  #include "access/nbtree.h"
  #include "catalog/index.h"
  #include "commands/tablespace.h"
*** a/src/backend/utils/sort/tuplestore.c
--- b/src/backend/utils/sort/tuplestore.c
***************
*** 54,59 ****
--- 54,60 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "commands/tablespace.h"
  #include "executor/executor.h"
  #include "storage/buffile.h"
*** a/src/backend/utils/time/snapmgr.c
--- b/src/backend/utils/time/snapmgr.c
***************
*** 48,53 ****
--- 48,54 ----
  #include "storage/procarray.h"
  #include "utils/builtins.h"
  #include "utils/memutils.h"
+ #include "utils/resowner_private.h"
  #include "utils/snapmgr.h"
  #include "utils/tqual.h"
  
*** a/src/backend/utils/time/tqual.c
--- b/src/backend/utils/time/tqual.c
***************
*** 57,62 ****
--- 57,63 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/multixact.h"
  #include "access/subtrans.h"
  #include "access/transam.h"
*** a/src/include/access/genam.h
--- b/src/include/access/genam.h
***************
*** 16,21 ****
--- 16,22 ----
  
  #include "access/sdir.h"
  #include "access/skey.h"
+ #include "lib/stringinfo.h"
  #include "nodes/tidbitmap.h"
  #include "storage/lock.h"
  #include "utils/relcache.h"
*** a/src/include/access/heapam.h
--- b/src/include/access/heapam.h
***************
*** 16,24 ****
  
  #include "access/sdir.h"
  #include "access/skey.h"
- #include "access/xlog.h"
  #include "nodes/primnodes.h"
  #include "storage/lock.h"
  #include "utils/relcache.h"
  #include "utils/snapshot.h"
  
--- 16,26 ----
  
  #include "access/sdir.h"
  #include "access/skey.h"
  #include "nodes/primnodes.h"
+ #include "storage/bufpage.h"
+ #include "storage/itemptr.h"
  #include "storage/lock.h"
+ #include "storage/relfilenode.h"
  #include "utils/relcache.h"
  #include "utils/snapshot.h"
  
***************
*** 125,151 **** extern void heap_restrpos(HeapScanDesc scan);
  
  extern void heap_sync(Relation relation);
  
- extern void heap_redo(XLogRecPtr lsn, XLogRecord *rptr);
- extern void heap_desc(StringInfo buf, uint8 xl_info, char *rec);
- extern void heap2_redo(XLogRecPtr lsn, XLogRecord *rptr);
- extern void heap2_desc(StringInfo buf, uint8 xl_info, char *rec);
- 
- extern XLogRecPtr log_heap_cleanup_info(RelFileNode rnode,
- 					  TransactionId latestRemovedXid);
- extern XLogRecPtr log_heap_clean(Relation reln, Buffer buffer,
- 			   OffsetNumber *redirected, int nredirected,
- 			   OffsetNumber *nowdead, int ndead,
- 			   OffsetNumber *nowunused, int nunused,
- 			   TransactionId latestRemovedXid);
- extern XLogRecPtr log_heap_freeze(Relation reln, Buffer buffer,
- 				TransactionId cutoff_xid,
- 				OffsetNumber *offsets, int offcnt);
- extern XLogRecPtr log_heap_visible(RelFileNode rnode, BlockNumber block,
- 				 Buffer vm_buffer, TransactionId cutoff_xid);
- extern XLogRecPtr log_newpage(RelFileNode *rnode, ForkNumber forkNum,
- 			BlockNumber blk, Page page);
- extern XLogRecPtr log_newpage_buffer(Buffer buffer);
- 
  /* in heap/pruneheap.c */
  extern void heap_page_prune_opt(Relation relation, Buffer buffer,
  					TransactionId OldestXmin);
--- 127,132 ----
*** /dev/null
--- b/src/include/access/heapam_xlog.h
***************
*** 0 ****
--- 1,264 ----
+ /*-------------------------------------------------------------------------
+  *
+  * heapam_xlog.h
+  *	  POSTGRES heap access XLOG definitions.
+  *
+  *
+  * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
+  * Portions Copyright (c) 1994, Regents of the University of California
+  *
+  * src/include/access/heapam_xlog.h
+  *
+  *-------------------------------------------------------------------------
+  */
+ #ifndef HEAPAM_XLOG_H
+ #define HEAPAM_XLOG_H
+ 
+ #include "access/htup.h"
+ #include "access/xlog.h"
+ #include "storage/relfilenode.h"
+ #include "utils/relcache.h"
+ 
+ 
+ /*
+  * WAL record definitions for heapam.c's WAL operations
+  *
+  * XLOG allows to store some information in high 4 bits of log
+  * record xl_info field.  We use 3 for opcode and one for init bit.
+  */
+ #define XLOG_HEAP_INSERT		0x00
+ #define XLOG_HEAP_DELETE		0x10
+ #define XLOG_HEAP_UPDATE		0x20
+ /* 0x030 is free, was XLOG_HEAP_MOVE */
+ #define XLOG_HEAP_HOT_UPDATE	0x40
+ #define XLOG_HEAP_NEWPAGE		0x50
+ #define XLOG_HEAP_LOCK			0x60
+ #define XLOG_HEAP_INPLACE		0x70
+ 
+ #define XLOG_HEAP_OPMASK		0x70
+ /*
+  * When we insert 1st item on new page in INSERT, UPDATE, HOT_UPDATE,
+  * or MULTI_INSERT, we can (and we do) restore entire page in redo
+  */
+ #define XLOG_HEAP_INIT_PAGE		0x80
+ /*
+  * We ran out of opcodes, so heapam.c now has a second RmgrId.	These opcodes
+  * are associated with RM_HEAP2_ID, but are not logically different from
+  * the ones above associated with RM_HEAP_ID.  XLOG_HEAP_OPMASK applies to
+  * these, too.
+  */
+ #define XLOG_HEAP2_FREEZE		0x00
+ #define XLOG_HEAP2_CLEAN		0x10
+ /* 0x20 is free, was XLOG_HEAP2_CLEAN_MOVE */
+ #define XLOG_HEAP2_CLEANUP_INFO 0x30
+ #define XLOG_HEAP2_VISIBLE		0x40
+ #define XLOG_HEAP2_MULTI_INSERT 0x50
+ 
+ /*
+  * All what we need to find changed tuple
+  *
+  * NB: on most machines, sizeof(xl_heaptid) will include some trailing pad
+  * bytes for alignment.  We don't want to store the pad space in the XLOG,
+  * so use SizeOfHeapTid for space calculations.  Similar comments apply for
+  * the other xl_FOO structs.
+  */
+ typedef struct xl_heaptid
+ {
+ 	RelFileNode node;
+ 	ItemPointerData tid;		/* changed tuple id */
+ } xl_heaptid;
+ 
+ #define SizeOfHeapTid		(offsetof(xl_heaptid, tid) + SizeOfIptrData)
+ 
+ /* This is what we need to know about delete */
+ typedef struct xl_heap_delete
+ {
+ 	xl_heaptid	target;			/* deleted tuple id */
+ 	bool		all_visible_cleared;	/* PD_ALL_VISIBLE was cleared */
+ } xl_heap_delete;
+ 
+ #define SizeOfHeapDelete	(offsetof(xl_heap_delete, all_visible_cleared) + sizeof(bool))
+ 
+ /*
+  * We don't store the whole fixed part (HeapTupleHeaderData) of an inserted
+  * or updated tuple in WAL; we can save a few bytes by reconstructing the
+  * fields that are available elsewhere in the WAL record, or perhaps just
+  * plain needn't be reconstructed.  These are the fields we must store.
+  * NOTE: t_hoff could be recomputed, but we may as well store it because
+  * it will come for free due to alignment considerations.
+  */
+ typedef struct xl_heap_header
+ {
+ 	uint16		t_infomask2;
+ 	uint16		t_infomask;
+ 	uint8		t_hoff;
+ } xl_heap_header;
+ 
+ #define SizeOfHeapHeader	(offsetof(xl_heap_header, t_hoff) + sizeof(uint8))
+ 
+ /* This is what we need to know about insert */
+ typedef struct xl_heap_insert
+ {
+ 	xl_heaptid	target;			/* inserted tuple id */
+ 	bool		all_visible_cleared;	/* PD_ALL_VISIBLE was cleared */
+ 	/* xl_heap_header & TUPLE DATA FOLLOWS AT END OF STRUCT */
+ } xl_heap_insert;
+ 
+ #define SizeOfHeapInsert	(offsetof(xl_heap_insert, all_visible_cleared) + sizeof(bool))
+ 
+ /*
+  * This is what we need to know about a multi-insert. The record consists of
+  * xl_heap_multi_insert header, followed by a xl_multi_insert_tuple and tuple
+  * data for each tuple. 'offsets' array is omitted if the whole page is
+  * reinitialized (XLOG_HEAP_INIT_PAGE)
+  */
+ typedef struct xl_heap_multi_insert
+ {
+ 	RelFileNode node;
+ 	BlockNumber blkno;
+ 	bool		all_visible_cleared;
+ 	uint16		ntuples;
+ 	OffsetNumber offsets[1];
+ 
+ 	/* TUPLE DATA (xl_multi_insert_tuples) FOLLOW AT END OF STRUCT */
+ } xl_heap_multi_insert;
+ 
+ #define SizeOfHeapMultiInsert	offsetof(xl_heap_multi_insert, offsets)
+ 
+ typedef struct xl_multi_insert_tuple
+ {
+ 	uint16		datalen;		/* size of tuple data that follows */
+ 	uint16		t_infomask2;
+ 	uint16		t_infomask;
+ 	uint8		t_hoff;
+ 	/* TUPLE DATA FOLLOWS AT END OF STRUCT */
+ } xl_multi_insert_tuple;
+ 
+ #define SizeOfMultiInsertTuple	(offsetof(xl_multi_insert_tuple, t_hoff) + sizeof(uint8))
+ 
+ /* This is what we need to know about update|hot_update */
+ typedef struct xl_heap_update
+ {
+ 	xl_heaptid	target;			/* deleted tuple id */
+ 	ItemPointerData newtid;		/* new inserted tuple id */
+ 	bool		all_visible_cleared;	/* PD_ALL_VISIBLE was cleared */
+ 	bool		new_all_visible_cleared;		/* same for the page of newtid */
+ 	/* NEW TUPLE xl_heap_header AND TUPLE DATA FOLLOWS AT END OF STRUCT */
+ } xl_heap_update;
+ 
+ #define SizeOfHeapUpdate	(offsetof(xl_heap_update, new_all_visible_cleared) + sizeof(bool))
+ 
+ /*
+  * This is what we need to know about vacuum page cleanup/redirect
+  *
+  * The array of OffsetNumbers following the fixed part of the record contains:
+  *	* for each redirected item: the item offset, then the offset redirected to
+  *	* for each now-dead item: the item offset
+  *	* for each now-unused item: the item offset
+  * The total number of OffsetNumbers is therefore 2*nredirected+ndead+nunused.
+  * Note that nunused is not explicitly stored, but may be found by reference
+  * to the total record length.
+  */
+ typedef struct xl_heap_clean
+ {
+ 	RelFileNode node;
+ 	BlockNumber block;
+ 	TransactionId latestRemovedXid;
+ 	uint16		nredirected;
+ 	uint16		ndead;
+ 	/* OFFSET NUMBERS FOLLOW */
+ } xl_heap_clean;
+ 
+ #define SizeOfHeapClean (offsetof(xl_heap_clean, ndead) + sizeof(uint16))
+ 
+ /*
+  * Cleanup_info is required in some cases during a lazy VACUUM.
+  * Used for reporting the results of HeapTupleHeaderAdvanceLatestRemovedXid()
+  * see vacuumlazy.c for full explanation
+  */
+ typedef struct xl_heap_cleanup_info
+ {
+ 	RelFileNode node;
+ 	TransactionId latestRemovedXid;
+ } xl_heap_cleanup_info;
+ 
+ #define SizeOfHeapCleanupInfo (sizeof(xl_heap_cleanup_info))
+ 
+ /* This is for replacing a page's contents in toto */
+ /* NB: this is used for indexes as well as heaps */
+ typedef struct xl_heap_newpage
+ {
+ 	RelFileNode node;
+ 	ForkNumber	forknum;
+ 	BlockNumber blkno;			/* location of new page */
+ 	/* entire page contents follow at end of record */
+ } xl_heap_newpage;
+ 
+ #define SizeOfHeapNewpage	(offsetof(xl_heap_newpage, blkno) + sizeof(BlockNumber))
+ 
+ /* This is what we need to know about lock */
+ typedef struct xl_heap_lock
+ {
+ 	xl_heaptid	target;			/* locked tuple id */
+ 	TransactionId locking_xid;	/* might be a MultiXactId not xid */
+ 	bool		xid_is_mxact;	/* is it? */
+ 	bool		shared_lock;	/* shared or exclusive row lock? */
+ } xl_heap_lock;
+ 
+ #define SizeOfHeapLock	(offsetof(xl_heap_lock, shared_lock) + sizeof(bool))
+ 
+ /* This is what we need to know about in-place update */
+ typedef struct xl_heap_inplace
+ {
+ 	xl_heaptid	target;			/* updated tuple id */
+ 	/* TUPLE DATA FOLLOWS AT END OF STRUCT */
+ } xl_heap_inplace;
+ 
+ #define SizeOfHeapInplace	(offsetof(xl_heap_inplace, target) + SizeOfHeapTid)
+ 
+ /* This is what we need to know about tuple freezing during vacuum */
+ typedef struct xl_heap_freeze
+ {
+ 	RelFileNode node;
+ 	BlockNumber block;
+ 	TransactionId cutoff_xid;
+ 	/* TUPLE OFFSET NUMBERS FOLLOW AT THE END */
+ } xl_heap_freeze;
+ 
+ #define SizeOfHeapFreeze (offsetof(xl_heap_freeze, cutoff_xid) + sizeof(TransactionId))
+ 
+ /* This is what we need to know about setting a visibility map bit */
+ typedef struct xl_heap_visible
+ {
+ 	RelFileNode node;
+ 	BlockNumber block;
+ 	TransactionId cutoff_xid;
+ } xl_heap_visible;
+ 
+ #define SizeOfHeapVisible (offsetof(xl_heap_visible, cutoff_xid) + sizeof(TransactionId))
+ 
+ extern void HeapTupleHeaderAdvanceLatestRemovedXid(HeapTupleHeader tuple,
+ 									   TransactionId *latestRemovedXid);
+ 
+ extern void heap_redo(XLogRecPtr lsn, XLogRecord *rptr);
+ extern void heap_desc(StringInfo buf, uint8 xl_info, char *rec);
+ extern void heap2_redo(XLogRecPtr lsn, XLogRecord *rptr);
+ extern void heap2_desc(StringInfo buf, uint8 xl_info, char *rec);
+ 
+ extern XLogRecPtr log_heap_cleanup_info(RelFileNode rnode,
+ 					  TransactionId latestRemovedXid);
+ extern XLogRecPtr log_heap_clean(Relation reln, Buffer buffer,
+ 			   OffsetNumber *redirected, int nredirected,
+ 			   OffsetNumber *nowdead, int ndead,
+ 			   OffsetNumber *nowunused, int nunused,
+ 			   TransactionId latestRemovedXid);
+ extern XLogRecPtr log_heap_freeze(Relation reln, Buffer buffer,
+ 				TransactionId cutoff_xid,
+ 				OffsetNumber *offsets, int offcnt);
+ extern XLogRecPtr log_heap_visible(RelFileNode rnode, BlockNumber block,
+ 				 Buffer vm_buffer, TransactionId cutoff_xid);
+ extern XLogRecPtr log_newpage(RelFileNode *rnode, ForkNumber forkNum,
+ 			BlockNumber blk, Page page);
+ extern XLogRecPtr log_newpage_buffer(Buffer buffer);
+ 
+ #endif   /* HEAPAM_XLOG_H */
*** a/src/include/access/hio.h
--- b/src/include/access/hio.h
***************
*** 15,21 ****
  #define HIO_H
  
  #include "access/heapam.h"
! #include "access/htup.h"
  #include "utils/relcache.h"
  #include "storage/buf.h"
  
--- 15,21 ----
  #define HIO_H
  
  #include "access/heapam.h"
! #include "access/tupbasics.h"
  #include "utils/relcache.h"
  #include "storage/buf.h"
  
*** a/src/include/access/htup.h
--- b/src/include/access/htup.h
***************
*** 14,24 ****
  #ifndef HTUP_H
  #define HTUP_H
  
  #include "access/tupdesc.h"
  #include "access/tupmacs.h"
  #include "storage/bufpage.h"
- #include "storage/itemptr.h"
- #include "storage/relfilenode.h"
  
  /*
   * MaxTupleAttributeNumber limits the number of (user) columns in a tuple.
--- 14,23 ----
  #ifndef HTUP_H
  #define HTUP_H
  
+ #include "access/tupbasics.h"
  #include "access/tupdesc.h"
  #include "access/tupmacs.h"
  #include "storage/bufpage.h"
  
  /*
   * MaxTupleAttributeNumber limits the number of (user) columns in a tuple.
***************
*** 130,136 **** typedef struct DatumTupleFields
  	 */
  } DatumTupleFields;
  
! typedef struct HeapTupleHeaderData
  {
  	union
  	{
--- 129,135 ----
  	 */
  } DatumTupleFields;
  
! struct HeapTupleHeaderData
  {
  	union
  	{
***************
*** 153,161 **** typedef struct HeapTupleHeaderData
  	bits8		t_bits[1];		/* bitmap of NULLs -- VARIABLE LENGTH */
  
  	/* MORE DATA FOLLOWS AT END OF STRUCT */
! } HeapTupleHeaderData;
! 
! typedef HeapTupleHeaderData *HeapTupleHeader;
  
  /*
   * information stored in t_infomask:
--- 152,159 ----
  	bits8		t_bits[1];		/* bitmap of NULLs -- VARIABLE LENGTH */
  
  	/* MORE DATA FOLLOWS AT END OF STRUCT */
! };
! /* typedef appears in tupbasics.h */
  
  /*
   * information stored in t_infomask:
***************
*** 425,431 **** do { \
   * tuples inside the executor, in places where transaction status information
   * is not required, the tuple rowtype is known, and shaving off a few bytes
   * is worthwhile because we need to store many tuples.	The representation
-  * is chosen so that tuple access routines can work with either full or
   * minimal tuples via a HeapTupleData pointer structure.  The access routines
   * see no difference, except that they must not access the transaction status
   * or t_ctid fields because those aren't there.
--- 423,428 ----
***************
*** 458,464 **** do { \
  #define MINIMAL_TUPLE_DATA_OFFSET \
  	offsetof(MinimalTupleData, t_infomask2)
  
! typedef struct MinimalTupleData
  {
  	uint32		t_len;			/* actual length of minimal tuple */
  
--- 455,461 ----
  #define MINIMAL_TUPLE_DATA_OFFSET \
  	offsetof(MinimalTupleData, t_infomask2)
  
! struct MinimalTupleData
  {
  	uint32		t_len;			/* actual length of minimal tuple */
  
***************
*** 477,530 **** typedef struct MinimalTupleData
  	bits8		t_bits[1];		/* bitmap of NULLs -- VARIABLE LENGTH */
  
  	/* MORE DATA FOLLOWS AT END OF STRUCT */
! } MinimalTupleData;
! 
! typedef MinimalTupleData *MinimalTuple;
! 
! 
! /*
!  * HeapTupleData is an in-memory data structure that points to a tuple.
!  *
!  * There are several ways in which this data structure is used:
!  *
!  * * Pointer to a tuple in a disk buffer: t_data points directly into the
!  *	 buffer (which the code had better be holding a pin on, but this is not
!  *	 reflected in HeapTupleData itself).
!  *
!  * * Pointer to nothing: t_data is NULL.  This is used as a failure indication
!  *	 in some functions.
!  *
!  * * Part of a palloc'd tuple: the HeapTupleData itself and the tuple
!  *	 form a single palloc'd chunk.  t_data points to the memory location
!  *	 immediately following the HeapTupleData struct (at offset HEAPTUPLESIZE).
!  *	 This is the output format of heap_form_tuple and related routines.
!  *
!  * * Separately allocated tuple: t_data points to a palloc'd chunk that
!  *	 is not adjacent to the HeapTupleData.	(This case is deprecated since
!  *	 it's difficult to tell apart from case #1.  It should be used only in
!  *	 limited contexts where the code knows that case #1 will never apply.)
!  *
!  * * Separately allocated minimal tuple: t_data points MINIMAL_TUPLE_OFFSET
!  *	 bytes before the start of a MinimalTuple.	As with the previous case,
!  *	 this can't be told apart from case #1 by inspection; code setting up
!  *	 or destroying this representation has to know what it's doing.
!  *
!  * t_len should always be valid, except in the pointer-to-nothing case.
!  * t_self and t_tableOid should be valid if the HeapTupleData points to
!  * a disk buffer, or if it represents a copy of a tuple on disk.  They
!  * should be explicitly set invalid in manufactured tuples.
!  */
! typedef struct HeapTupleData
! {
! 	uint32		t_len;			/* length of *t_data */
! 	ItemPointerData t_self;		/* SelfItemPointer */
! 	Oid			t_tableOid;		/* table the tuple came from */
! 	HeapTupleHeader t_data;		/* -> tuple header and data */
! } HeapTupleData;
! 
! typedef HeapTupleData *HeapTuple;
  
- #define HEAPTUPLESIZE	MAXALIGN(sizeof(HeapTupleData))
  
  /*
   * GETSTRUCT - given a HeapTuple pointer, return address of the user data
--- 474,482 ----
  	bits8		t_bits[1];		/* bitmap of NULLs -- VARIABLE LENGTH */
  
  	/* MORE DATA FOLLOWS AT END OF STRUCT */
! };
! /* typedef appears in tupbasics.h */
  
  
  /*
   * GETSTRUCT - given a HeapTuple pointer, return address of the user data
***************
*** 534,540 **** typedef HeapTupleData *HeapTuple;
  /*
   * Accessor macros to be used with HeapTuple pointers.
   */
- #define HeapTupleIsValid(tuple) PointerIsValid(tuple)
  
  #define HeapTupleHasNulls(tuple) \
  		(((tuple)->t_data->t_infomask & HEAP_HASNULL) != 0)
--- 486,491 ----
***************
*** 575,801 **** typedef HeapTupleData *HeapTuple;
  #define HeapTupleSetOid(tuple, oid) \
  		HeapTupleHeaderSetOid((tuple)->t_data, (oid))
  
- 
- /*
-  * WAL record definitions for heapam.c's WAL operations
-  *
-  * XLOG allows to store some information in high 4 bits of log
-  * record xl_info field.  We use 3 for opcode and one for init bit.
-  */
- #define XLOG_HEAP_INSERT		0x00
- #define XLOG_HEAP_DELETE		0x10
- #define XLOG_HEAP_UPDATE		0x20
- /* 0x030 is free, was XLOG_HEAP_MOVE */
- #define XLOG_HEAP_HOT_UPDATE	0x40
- #define XLOG_HEAP_NEWPAGE		0x50
- #define XLOG_HEAP_LOCK			0x60
- #define XLOG_HEAP_INPLACE		0x70
- 
- #define XLOG_HEAP_OPMASK		0x70
- /*
-  * When we insert 1st item on new page in INSERT, UPDATE, HOT_UPDATE,
-  * or MULTI_INSERT, we can (and we do) restore entire page in redo
-  */
- #define XLOG_HEAP_INIT_PAGE		0x80
- /*
-  * We ran out of opcodes, so heapam.c now has a second RmgrId.	These opcodes
-  * are associated with RM_HEAP2_ID, but are not logically different from
-  * the ones above associated with RM_HEAP_ID.  XLOG_HEAP_OPMASK applies to
-  * these, too.
-  */
- #define XLOG_HEAP2_FREEZE		0x00
- #define XLOG_HEAP2_CLEAN		0x10
- /* 0x20 is free, was XLOG_HEAP2_CLEAN_MOVE */
- #define XLOG_HEAP2_CLEANUP_INFO 0x30
- #define XLOG_HEAP2_VISIBLE		0x40
- #define XLOG_HEAP2_MULTI_INSERT 0x50
- 
- /*
-  * All what we need to find changed tuple
-  *
-  * NB: on most machines, sizeof(xl_heaptid) will include some trailing pad
-  * bytes for alignment.  We don't want to store the pad space in the XLOG,
-  * so use SizeOfHeapTid for space calculations.  Similar comments apply for
-  * the other xl_FOO structs.
-  */
- typedef struct xl_heaptid
- {
- 	RelFileNode node;
- 	ItemPointerData tid;		/* changed tuple id */
- } xl_heaptid;
- 
- #define SizeOfHeapTid		(offsetof(xl_heaptid, tid) + SizeOfIptrData)
- 
- /* This is what we need to know about delete */
- typedef struct xl_heap_delete
- {
- 	xl_heaptid	target;			/* deleted tuple id */
- 	bool		all_visible_cleared;	/* PD_ALL_VISIBLE was cleared */
- } xl_heap_delete;
- 
- #define SizeOfHeapDelete	(offsetof(xl_heap_delete, all_visible_cleared) + sizeof(bool))
- 
- /*
-  * We don't store the whole fixed part (HeapTupleHeaderData) of an inserted
-  * or updated tuple in WAL; we can save a few bytes by reconstructing the
-  * fields that are available elsewhere in the WAL record, or perhaps just
-  * plain needn't be reconstructed.  These are the fields we must store.
-  * NOTE: t_hoff could be recomputed, but we may as well store it because
-  * it will come for free due to alignment considerations.
-  */
- typedef struct xl_heap_header
- {
- 	uint16		t_infomask2;
- 	uint16		t_infomask;
- 	uint8		t_hoff;
- } xl_heap_header;
- 
- #define SizeOfHeapHeader	(offsetof(xl_heap_header, t_hoff) + sizeof(uint8))
- 
- /* This is what we need to know about insert */
- typedef struct xl_heap_insert
- {
- 	xl_heaptid	target;			/* inserted tuple id */
- 	bool		all_visible_cleared;	/* PD_ALL_VISIBLE was cleared */
- 	/* xl_heap_header & TUPLE DATA FOLLOWS AT END OF STRUCT */
- } xl_heap_insert;
- 
- #define SizeOfHeapInsert	(offsetof(xl_heap_insert, all_visible_cleared) + sizeof(bool))
- 
- /*
-  * This is what we need to know about a multi-insert. The record consists of
-  * xl_heap_multi_insert header, followed by a xl_multi_insert_tuple and tuple
-  * data for each tuple. 'offsets' array is omitted if the whole page is
-  * reinitialized (XLOG_HEAP_INIT_PAGE)
-  */
- typedef struct xl_heap_multi_insert
- {
- 	RelFileNode node;
- 	BlockNumber blkno;
- 	bool		all_visible_cleared;
- 	uint16		ntuples;
- 	OffsetNumber offsets[1];
- 
- 	/* TUPLE DATA (xl_multi_insert_tuples) FOLLOW AT END OF STRUCT */
- } xl_heap_multi_insert;
- 
- #define SizeOfHeapMultiInsert	offsetof(xl_heap_multi_insert, offsets)
- 
- typedef struct xl_multi_insert_tuple
- {
- 	uint16		datalen;		/* size of tuple data that follows */
- 	uint16		t_infomask2;
- 	uint16		t_infomask;
- 	uint8		t_hoff;
- 	/* TUPLE DATA FOLLOWS AT END OF STRUCT */
- } xl_multi_insert_tuple;
- 
- #define SizeOfMultiInsertTuple	(offsetof(xl_multi_insert_tuple, t_hoff) + sizeof(uint8))
- 
- /* This is what we need to know about update|hot_update */
- typedef struct xl_heap_update
- {
- 	xl_heaptid	target;			/* deleted tuple id */
- 	ItemPointerData newtid;		/* new inserted tuple id */
- 	bool		all_visible_cleared;	/* PD_ALL_VISIBLE was cleared */
- 	bool		new_all_visible_cleared;		/* same for the page of newtid */
- 	/* NEW TUPLE xl_heap_header AND TUPLE DATA FOLLOWS AT END OF STRUCT */
- } xl_heap_update;
- 
- #define SizeOfHeapUpdate	(offsetof(xl_heap_update, new_all_visible_cleared) + sizeof(bool))
- 
- /*
-  * This is what we need to know about vacuum page cleanup/redirect
-  *
-  * The array of OffsetNumbers following the fixed part of the record contains:
-  *	* for each redirected item: the item offset, then the offset redirected to
-  *	* for each now-dead item: the item offset
-  *	* for each now-unused item: the item offset
-  * The total number of OffsetNumbers is therefore 2*nredirected+ndead+nunused.
-  * Note that nunused is not explicitly stored, but may be found by reference
-  * to the total record length.
-  */
- typedef struct xl_heap_clean
- {
- 	RelFileNode node;
- 	BlockNumber block;
- 	TransactionId latestRemovedXid;
- 	uint16		nredirected;
- 	uint16		ndead;
- 	/* OFFSET NUMBERS FOLLOW */
- } xl_heap_clean;
- 
- #define SizeOfHeapClean (offsetof(xl_heap_clean, ndead) + sizeof(uint16))
- 
- /*
-  * Cleanup_info is required in some cases during a lazy VACUUM.
-  * Used for reporting the results of HeapTupleHeaderAdvanceLatestRemovedXid()
-  * see vacuumlazy.c for full explanation
-  */
- typedef struct xl_heap_cleanup_info
- {
- 	RelFileNode node;
- 	TransactionId latestRemovedXid;
- } xl_heap_cleanup_info;
- 
- #define SizeOfHeapCleanupInfo (sizeof(xl_heap_cleanup_info))
- 
- /* This is for replacing a page's contents in toto */
- /* NB: this is used for indexes as well as heaps */
- typedef struct xl_heap_newpage
- {
- 	RelFileNode node;
- 	ForkNumber	forknum;
- 	BlockNumber blkno;			/* location of new page */
- 	/* entire page contents follow at end of record */
- } xl_heap_newpage;
- 
- #define SizeOfHeapNewpage	(offsetof(xl_heap_newpage, blkno) + sizeof(BlockNumber))
- 
- /* This is what we need to know about lock */
- typedef struct xl_heap_lock
- {
- 	xl_heaptid	target;			/* locked tuple id */
- 	TransactionId locking_xid;	/* might be a MultiXactId not xid */
- 	bool		xid_is_mxact;	/* is it? */
- 	bool		shared_lock;	/* shared or exclusive row lock? */
- } xl_heap_lock;
- 
- #define SizeOfHeapLock	(offsetof(xl_heap_lock, shared_lock) + sizeof(bool))
- 
- /* This is what we need to know about in-place update */
- typedef struct xl_heap_inplace
- {
- 	xl_heaptid	target;			/* updated tuple id */
- 	/* TUPLE DATA FOLLOWS AT END OF STRUCT */
- } xl_heap_inplace;
- 
- #define SizeOfHeapInplace	(offsetof(xl_heap_inplace, target) + SizeOfHeapTid)
- 
- /* This is what we need to know about tuple freezing during vacuum */
- typedef struct xl_heap_freeze
- {
- 	RelFileNode node;
- 	BlockNumber block;
- 	TransactionId cutoff_xid;
- 	/* TUPLE OFFSET NUMBERS FOLLOW AT THE END */
- } xl_heap_freeze;
- 
- #define SizeOfHeapFreeze (offsetof(xl_heap_freeze, cutoff_xid) + sizeof(TransactionId))
- 
- /* This is what we need to know about setting a visibility map bit */
- typedef struct xl_heap_visible
- {
- 	RelFileNode node;
- 	BlockNumber block;
- 	TransactionId cutoff_xid;
- } xl_heap_visible;
- 
- #define SizeOfHeapVisible (offsetof(xl_heap_visible, cutoff_xid) + sizeof(TransactionId))
- 
- extern void HeapTupleHeaderAdvanceLatestRemovedXid(HeapTupleHeader tuple,
- 									   TransactionId *latestRemovedXid);
- 
  /* HeapTupleHeader functions implemented in utils/time/combocid.c */
  extern CommandId HeapTupleHeaderGetCmin(HeapTupleHeader tup);
  extern CommandId HeapTupleHeaderGetCmax(HeapTupleHeader tup);
--- 526,531 ----
*** a/src/include/access/printtup.h
--- b/src/include/access/printtup.h
***************
*** 14,19 ****
--- 14,21 ----
  #ifndef PRINTTUP_H
  #define PRINTTUP_H
  
+ #include "access/tupdesc.h"
+ #include "tcop/dest.h"
  #include "utils/portal.h"
  
  extern DestReceiver *printtup_create_DR(CommandDest dest);
*** a/src/include/access/reloptions.h
--- b/src/include/access/reloptions.h
***************
*** 19,25 ****
  #ifndef RELOPTIONS_H
  #define RELOPTIONS_H
  
! #include "access/htup.h"
  #include "nodes/pg_list.h"
  
  /* types supported by reloptions */
--- 19,26 ----
  #ifndef RELOPTIONS_H
  #define RELOPTIONS_H
  
! #include "access/tupbasics.h"
! #include "access/tupdesc.h"
  #include "nodes/pg_list.h"
  
  /* types supported by reloptions */
*** a/src/include/access/relscan.h
--- b/src/include/access/relscan.h
***************
*** 16,21 ****
--- 16,22 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/htup.h"
  #include "access/itup.h"
  #include "access/tupdesc.h"
  
*** a/src/include/access/rewriteheap.h
--- b/src/include/access/rewriteheap.h
***************
*** 13,19 ****
  #ifndef REWRITE_HEAP_H
  #define REWRITE_HEAP_H
  
! #include "access/htup.h"
  #include "utils/relcache.h"
  
  /* struct definition is private to rewriteheap.c */
--- 13,19 ----
  #ifndef REWRITE_HEAP_H
  #define REWRITE_HEAP_H
  
! #include "access/tupbasics.h"
  #include "utils/relcache.h"
  
  /* struct definition is private to rewriteheap.c */
*** /dev/null
--- b/src/include/access/tupbasics.h
***************
*** 0 ****
--- 1,77 ----
+ /*-------------------------------------------------------------------------
+  * tupbasics.h
+  * 		POSTGRES tuple struct forward declarations
+  *
+  * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
+  * Portions Copyright (c) 1994, Regents of the University of California
+  *
+  *
+  * src/include/access/tupbasics.h
+  *-------------------------------------------------------------------------
+  */
+ #ifndef TUPBASICS_H
+ #define TUPBASICS_H
+ 
+ #include "storage/itemptr.h"
+ 
+ /* typedefs and forward declarations for structs defined in htupdata.h */
+ 
+ typedef struct HeapTupleHeaderData HeapTupleHeaderData;
+ 
+ typedef HeapTupleHeaderData *HeapTupleHeader;
+ 
+ typedef struct MinimalTupleData MinimalTupleData;
+ 
+ typedef MinimalTupleData *MinimalTuple;
+ 
+ #define HEAPTUPLESIZE	MAXALIGN(sizeof(HeapTupleData))
+ 
+ /*
+  * HeapTupleData is an in-memory data structure that points to a tuple.
+  *
+  * There are several ways in which this data structure is used:
+  *
+  * * Pointer to a tuple in a disk buffer: t_data points directly into the
+  *	 buffer (which the code had better be holding a pin on, but this is not
+  *	 reflected in HeapTupleData itself).
+  *
+  * * Pointer to nothing: t_data is NULL.  This is used as a failure indication
+  *	 in some functions.
+  *
+  * * Part of a palloc'd tuple: the HeapTupleData itself and the tuple
+  *	 form a single palloc'd chunk.  t_data points to the memory location
+  *	 immediately following the HeapTupleData struct (at offset HEAPTUPLESIZE).
+  *	 This is the output format of heap_form_tuple and related routines.
+  *
+  * * Separately allocated tuple: t_data points to a palloc'd chunk that
+  *	 is not adjacent to the HeapTupleData.	(This case is deprecated since
+  *	 it's difficult to tell apart from case #1.  It should be used only in
+  *	 limited contexts where the code knows that case #1 will never apply.)
+  *
+  * * Separately allocated minimal tuple: t_data points MINIMAL_TUPLE_OFFSET
+  *	 bytes before the start of a MinimalTuple.	As with the previous case,
+  *	 this can't be told apart from case #1 by inspection; code setting up
+  *	 or destroying this representation has to know what it's doing.
+  *
+  * t_len should always be valid, except in the pointer-to-nothing case.
+  * t_self and t_tableOid should be valid if the HeapTupleData points to
+  * a disk buffer, or if it represents a copy of a tuple on disk.  They
+  * should be explicitly set invalid in manufactured tuples.
+  */
+ typedef struct HeapTupleData
+ {
+ 	uint32		t_len;			/* length of *t_data */
+ 	ItemPointerData t_self;		/* SelfItemPointer */
+ 	Oid			t_tableOid;		/* table the tuple came from */
+ 	HeapTupleHeader t_data;		/* -> tuple header and data */
+ } HeapTupleData;
+ 
+ typedef HeapTupleData *HeapTuple;
+ 
+ /*
+  * Accessor macros to be used with HeapTuple pointers.
+  */
+ #define HeapTupleIsValid(tuple) PointerIsValid(tuple)
+ 
+ 
+ #endif /* TUPBASICS_H */
*** a/src/include/access/tupconvert.h
--- b/src/include/access/tupconvert.h
***************
*** 14,20 ****
  #ifndef TUPCONVERT_H
  #define TUPCONVERT_H
  
! #include "access/htup.h"
  
  
  typedef struct TupleConversionMap
--- 14,21 ----
  #ifndef TUPCONVERT_H
  #define TUPCONVERT_H
  
! #include "access/tupbasics.h"
! #include "access/tupdesc.h"
  
  
  typedef struct TupleConversionMap
*** a/src/include/catalog/indexing.h
--- b/src/include/catalog/indexing.h
***************
*** 15,21 ****
  #ifndef INDEXING_H
  #define INDEXING_H
  
! #include "access/htup.h"
  #include "utils/relcache.h"
  
  /*
--- 15,21 ----
  #ifndef INDEXING_H
  #define INDEXING_H
  
! #include "access/tupbasics.h"
  #include "utils/relcache.h"
  
  /*
*** a/src/include/commands/explain.h
--- b/src/include/commands/explain.h
***************
*** 14,19 ****
--- 14,20 ----
  #define EXPLAIN_H
  
  #include "executor/executor.h"
+ #include "lib/stringinfo.h"
  
  typedef enum ExplainFormat
  {
*** a/src/include/commands/portalcmds.h
--- b/src/include/commands/portalcmds.h
***************
*** 15,21 ****
--- 15,23 ----
  #define PORTALCMDS_H
  
  #include "nodes/parsenodes.h"
+ #include "nodes/plannodes.h"
  #include "utils/portal.h"
+ #include "tcop/dest.h"
  
  
  extern void PerformCursorOpen(PlannedStmt *stmt, ParamListInfo params,
*** a/src/include/commands/prepare.h
--- b/src/include/commands/prepare.h
***************
*** 14,19 ****
--- 14,20 ----
  #define PREPARE_H
  
  #include "commands/explain.h"
+ #include "datatype/timestamp.h"
  #include "utils/plancache.h"
  
  /*
*** a/src/include/commands/tablecmds.h
--- b/src/include/commands/tablecmds.h
***************
*** 14,20 ****
  #ifndef TABLECMDS_H
  #define TABLECMDS_H
  
! #include "access/htup.h"
  #include "nodes/parsenodes.h"
  #include "storage/lock.h"
  #include "utils/relcache.h"
--- 14,20 ----
  #ifndef TABLECMDS_H
  #define TABLECMDS_H
  
! #include "access/tupbasics.h"
  #include "nodes/parsenodes.h"
  #include "storage/lock.h"
  #include "utils/relcache.h"
*** a/src/include/commands/typecmds.h
--- b/src/include/commands/typecmds.h
***************
*** 14,20 ****
  #ifndef TYPECMDS_H
  #define TYPECMDS_H
  
! #include "access/htup.h"
  #include "nodes/parsenodes.h"
  
  
--- 14,20 ----
  #ifndef TYPECMDS_H
  #define TYPECMDS_H
  
! #include "access/tupbasics.h"
  #include "nodes/parsenodes.h"
  
  
*** a/src/include/commands/vacuum.h
--- b/src/include/commands/vacuum.h
***************
*** 14,23 ****
  #ifndef VACUUM_H
  #define VACUUM_H
  
! #include "access/htup.h"
  #include "catalog/pg_statistic.h"
  #include "catalog/pg_type.h"
  #include "nodes/parsenodes.h"
  #include "storage/buf.h"
  #include "storage/lock.h"
  #include "utils/relcache.h"
--- 14,24 ----
  #ifndef VACUUM_H
  #define VACUUM_H
  
! #include "access/tupbasics.h"
  #include "catalog/pg_statistic.h"
  #include "catalog/pg_type.h"
  #include "nodes/parsenodes.h"
+ #include "storage/block.h"
  #include "storage/buf.h"
  #include "storage/lock.h"
  #include "utils/relcache.h"
*** a/src/include/executor/spi.h
--- b/src/include/executor/spi.h
***************
*** 15,20 ****
--- 15,22 ----
  
  #include "nodes/parsenodes.h"
  #include "utils/portal.h"
+ #include "utils/relcache.h"
+ #include "utils/snapshot.h"
  
  
  typedef struct SPITupleTable
*** a/src/include/executor/tuptable.h
--- b/src/include/executor/tuptable.h
***************
*** 14,20 ****
  #ifndef TUPTABLE_H
  #define TUPTABLE_H
  
! #include "access/htup.h"
  #include "storage/buf.h"
  
  /*----------
--- 14,22 ----
  #ifndef TUPTABLE_H
  #define TUPTABLE_H
  
! #include "access/tupbasics.h"
! #include "access/tupdesc.h"
! #include "nodes/nodes.h"
  #include "storage/buf.h"
  
  /*----------
*** a/src/include/funcapi.h
--- b/src/include/funcapi.h
***************
*** 17,22 ****
--- 17,23 ----
  #define FUNCAPI_H
  
  #include "fmgr.h"
+ #include "access/tupbasics.h"
  #include "access/tupdesc.h"
  #include "executor/executor.h"
  #include "executor/tuptable.h"
*** a/src/include/nodes/execnodes.h
--- b/src/include/nodes/execnodes.h
***************
*** 16,21 ****
--- 16,22 ----
  
  #include "access/genam.h"
  #include "access/heapam.h"
+ #include "access/tupbasics.h"
  #include "executor/instrument.h"
  #include "nodes/params.h"
  #include "nodes/plannodes.h"
*** a/src/include/nodes/print.h
--- b/src/include/nodes/print.h
***************
*** 15,20 ****
--- 15,21 ----
  #define PRINT_H
  
  #include "executor/tuptable.h"
+ #include "lib/stringinfo.h"
  
  
  #define nodeDisplay(x)		pprint(x)
*** a/src/include/parser/parse_oper.h
--- b/src/include/parser/parse_oper.h
***************
*** 14,20 ****
  #ifndef PARSE_OPER_H
  #define PARSE_OPER_H
  
! #include "access/htup.h"
  #include "parser/parse_node.h"
  
  
--- 14,20 ----
  #ifndef PARSE_OPER_H
  #define PARSE_OPER_H
  
! #include "access/tupbasics.h"
  #include "parser/parse_node.h"
  
  
*** a/src/include/parser/parse_type.h
--- b/src/include/parser/parse_type.h
***************
*** 13,19 ****
  #ifndef PARSE_TYPE_H
  #define PARSE_TYPE_H
  
! #include "access/htup.h"
  #include "parser/parse_node.h"
  
  
--- 13,19 ----
  #ifndef PARSE_TYPE_H
  #define PARSE_TYPE_H
  
! #include "access/tupbasics.h"
  #include "parser/parse_node.h"
  
  
*** a/src/include/storage/predicate.h
--- b/src/include/storage/predicate.h
***************
*** 14,19 ****
--- 14,20 ----
  #ifndef PREDICATE_H
  #define PREDICATE_H
  
+ #include "storage/block.h"
  #include "utils/relcache.h"
  #include "utils/snapshot.h"
  
*** a/src/include/tcop/pquery.h
--- b/src/include/tcop/pquery.h
***************
*** 16,21 ****
--- 16,22 ----
  
  #include "nodes/parsenodes.h"
  #include "utils/portal.h"
+ #include "tcop/dest.h"
  
  
  extern PGDLLIMPORT Portal ActivePortal;
*** a/src/include/tcop/tcopprot.h
--- b/src/include/tcop/tcopprot.h
***************
*** 19,26 ****
  #ifndef TCOPPROT_H
  #define TCOPPROT_H
  
! #include "executor/execdesc.h"
  #include "nodes/parsenodes.h"
  #include "storage/procsignal.h"
  #include "utils/guc.h"
  
--- 19,27 ----
  #ifndef TCOPPROT_H
  #define TCOPPROT_H
  
! #include "nodes/params.h"
  #include "nodes/parsenodes.h"
+ #include "nodes/plannodes.h"
  #include "storage/procsignal.h"
  #include "utils/guc.h"
  
*** a/src/include/utils/catcache.h
--- b/src/include/utils/catcache.h
***************
*** 20,27 ****
  #ifndef CATCACHE_H
  #define CATCACHE_H
  
- #include "access/htup.h"
  #include "access/skey.h"
  #include "lib/dllist.h"
  #include "utils/relcache.h"
  
--- 20,27 ----
  #ifndef CATCACHE_H
  #define CATCACHE_H
  
  #include "access/skey.h"
+ #include "access/tupbasics.h"
  #include "lib/dllist.h"
  #include "utils/relcache.h"
  
*** a/src/include/utils/guc.h
--- b/src/include/utils/guc.h
***************
*** 13,18 ****
--- 13,19 ----
  #ifndef GUC_H
  #define GUC_H
  
+ #include "access/tupdesc.h"
  #include "nodes/parsenodes.h"
  #include "tcop/dest.h"
  #include "utils/array.h"
*** a/src/include/utils/inval.h
--- b/src/include/utils/inval.h
***************
*** 14,20 ****
  #ifndef INVAL_H
  #define INVAL_H
  
! #include "access/htup.h"
  #include "utils/relcache.h"
  
  
--- 14,21 ----
  #ifndef INVAL_H
  #define INVAL_H
  
! #include "access/tupbasics.h"
! #include "storage/relfilenode.h"
  #include "utils/relcache.h"
  
  
*** a/src/include/utils/lsyscache.h
--- b/src/include/utils/lsyscache.h
***************
*** 13,19 ****
  #ifndef LSYSCACHE_H
  #define LSYSCACHE_H
  
! #include "access/htup.h"
  
  /* Result list element for get_op_btree_interpretation */
  typedef struct OpBtreeInterpretation
--- 13,22 ----
  #ifndef LSYSCACHE_H
  #define LSYSCACHE_H
  
! #include "access/attnum.h"
! #include "access/tupbasics.h"
! #include "nodes/pg_list.h"
! #include "nodes/nodes.h"
  
  /* Result list element for get_op_btree_interpretation */
  typedef struct OpBtreeInterpretation
*** a/src/include/utils/portal.h
--- b/src/include/utils/portal.h
***************
*** 48,54 ****
--- 48,56 ----
  
  #include "datatype/timestamp.h"
  #include "executor/execdesc.h"
+ #include "utils/plancache.h"
  #include "utils/resowner.h"
+ #include "utils/tuplestore.h"
  
  /*
   * We have several execution strategies for Portals, depending on what
*** a/src/include/utils/resowner.h
--- b/src/include/utils/resowner.h
***************
*** 19,30 ****
  #ifndef RESOWNER_H
  #define RESOWNER_H
  
- #include "storage/fd.h"
- #include "storage/lock.h"
- #include "utils/catcache.h"
- #include "utils/plancache.h"
- #include "utils/snapshot.h"
- 
  
  /*
   * ResourceOwner objects are an opaque data structure known only within
--- 19,24 ----
***************
*** 85,144 **** extern void RegisterResourceReleaseCallback(ResourceReleaseCallback callback,
  extern void UnregisterResourceReleaseCallback(ResourceReleaseCallback callback,
  								  void *arg);
  
- /* support for buffer refcount management */
- extern void ResourceOwnerEnlargeBuffers(ResourceOwner owner);
- extern void ResourceOwnerRememberBuffer(ResourceOwner owner, Buffer buffer);
- extern void ResourceOwnerForgetBuffer(ResourceOwner owner, Buffer buffer);
- 
- /* support for local lock management */
- extern void ResourceOwnerRememberLock(ResourceOwner owner, LOCALLOCK *locallock);
- extern void ResourceOwnerForgetLock(ResourceOwner owner, LOCALLOCK *locallock);
- 
- /* support for catcache refcount management */
- extern void ResourceOwnerEnlargeCatCacheRefs(ResourceOwner owner);
- extern void ResourceOwnerRememberCatCacheRef(ResourceOwner owner,
- 								 HeapTuple tuple);
- extern void ResourceOwnerForgetCatCacheRef(ResourceOwner owner,
- 							   HeapTuple tuple);
- extern void ResourceOwnerEnlargeCatCacheListRefs(ResourceOwner owner);
- extern void ResourceOwnerRememberCatCacheListRef(ResourceOwner owner,
- 									 CatCList *list);
- extern void ResourceOwnerForgetCatCacheListRef(ResourceOwner owner,
- 								   CatCList *list);
- 
- /* support for relcache refcount management */
- extern void ResourceOwnerEnlargeRelationRefs(ResourceOwner owner);
- extern void ResourceOwnerRememberRelationRef(ResourceOwner owner,
- 								 Relation rel);
- extern void ResourceOwnerForgetRelationRef(ResourceOwner owner,
- 							   Relation rel);
- 
- /* support for plancache refcount management */
- extern void ResourceOwnerEnlargePlanCacheRefs(ResourceOwner owner);
- extern void ResourceOwnerRememberPlanCacheRef(ResourceOwner owner,
- 								  CachedPlan *plan);
- extern void ResourceOwnerForgetPlanCacheRef(ResourceOwner owner,
- 								CachedPlan *plan);
- 
- /* support for tupledesc refcount management */
- extern void ResourceOwnerEnlargeTupleDescs(ResourceOwner owner);
- extern void ResourceOwnerRememberTupleDesc(ResourceOwner owner,
- 							   TupleDesc tupdesc);
- extern void ResourceOwnerForgetTupleDesc(ResourceOwner owner,
- 							 TupleDesc tupdesc);
- 
- /* support for snapshot refcount management */
- extern void ResourceOwnerEnlargeSnapshots(ResourceOwner owner);
- extern void ResourceOwnerRememberSnapshot(ResourceOwner owner,
- 							  Snapshot snapshot);
- extern void ResourceOwnerForgetSnapshot(ResourceOwner owner,
- 							Snapshot snapshot);
- 
- /* support for temporary file management */
- extern void ResourceOwnerEnlargeFiles(ResourceOwner owner);
- extern void ResourceOwnerRememberFile(ResourceOwner owner,
- 						  File file);
- extern void ResourceOwnerForgetFile(ResourceOwner owner,
- 						File file);
- 
  #endif   /* RESOWNER_H */
--- 79,82 ----
*** /dev/null
--- b/src/include/utils/resowner_private.h
***************
*** 0 ****
--- 1,83 ----
+ /*-------------------------------------------------------------------------
+  *
+  * resowner_private.h
+  *	  POSTGRES resource owner private definitions.
+  *
+  * See utils/resowner/README for more info.
+  *
+  *
+  * Portions Copyright (c) 1996-2012, PostgreSQL Global Development Group
+  * Portions Copyright (c) 1994, Regents of the University of California
+  *
+  * src/include/utils/resowner_private.h
+  *
+  *-------------------------------------------------------------------------
+  */
+ #ifndef RESOWNER_PRIVATE_H
+ #define RESOWNER_PRIVATE_H
+ 
+ #include "storage/fd.h"
+ #include "storage/lock.h"
+ #include "utils/catcache.h"
+ #include "utils/plancache.h"
+ #include "utils/resowner.h"
+ #include "utils/snapshot.h"
+ 
+ 
+ /* support for buffer refcount management */
+ extern void ResourceOwnerEnlargeBuffers(ResourceOwner owner);
+ extern void ResourceOwnerRememberBuffer(ResourceOwner owner, Buffer buffer);
+ extern void ResourceOwnerForgetBuffer(ResourceOwner owner, Buffer buffer);
+ 
+ /* support for local lock management */
+ extern void ResourceOwnerRememberLock(ResourceOwner owner, LOCALLOCK *locallock);
+ extern void ResourceOwnerForgetLock(ResourceOwner owner, LOCALLOCK *locallock);
+ 
+ /* support for catcache refcount management */
+ extern void ResourceOwnerEnlargeCatCacheRefs(ResourceOwner owner);
+ extern void ResourceOwnerRememberCatCacheRef(ResourceOwner owner,
+ 								 HeapTuple tuple);
+ extern void ResourceOwnerForgetCatCacheRef(ResourceOwner owner,
+ 							   HeapTuple tuple);
+ extern void ResourceOwnerEnlargeCatCacheListRefs(ResourceOwner owner);
+ extern void ResourceOwnerRememberCatCacheListRef(ResourceOwner owner,
+ 									 CatCList *list);
+ extern void ResourceOwnerForgetCatCacheListRef(ResourceOwner owner,
+ 								   CatCList *list);
+ 
+ /* support for relcache refcount management */
+ extern void ResourceOwnerEnlargeRelationRefs(ResourceOwner owner);
+ extern void ResourceOwnerRememberRelationRef(ResourceOwner owner,
+ 								 Relation rel);
+ extern void ResourceOwnerForgetRelationRef(ResourceOwner owner,
+ 							   Relation rel);
+ 
+ /* support for plancache refcount management */
+ extern void ResourceOwnerEnlargePlanCacheRefs(ResourceOwner owner);
+ extern void ResourceOwnerRememberPlanCacheRef(ResourceOwner owner,
+ 								  CachedPlan *plan);
+ extern void ResourceOwnerForgetPlanCacheRef(ResourceOwner owner,
+ 								CachedPlan *plan);
+ 
+ /* support for tupledesc refcount management */
+ extern void ResourceOwnerEnlargeTupleDescs(ResourceOwner owner);
+ extern void ResourceOwnerRememberTupleDesc(ResourceOwner owner,
+ 							   TupleDesc tupdesc);
+ extern void ResourceOwnerForgetTupleDesc(ResourceOwner owner,
+ 							 TupleDesc tupdesc);
+ 
+ /* support for snapshot refcount management */
+ extern void ResourceOwnerEnlargeSnapshots(ResourceOwner owner);
+ extern void ResourceOwnerRememberSnapshot(ResourceOwner owner,
+ 							  Snapshot snapshot);
+ extern void ResourceOwnerForgetSnapshot(ResourceOwner owner,
+ 							Snapshot snapshot);
+ 
+ /* support for temporary file management */
+ extern void ResourceOwnerEnlargeFiles(ResourceOwner owner);
+ extern void ResourceOwnerRememberFile(ResourceOwner owner,
+ 						  File file);
+ extern void ResourceOwnerForgetFile(ResourceOwner owner,
+ 						File file);
+ 
+ #endif   /* RESOWNER_PRIVATE_H */
*** a/src/include/utils/selfuncs.h
--- b/src/include/utils/selfuncs.h
***************
*** 16,22 ****
  #define SELFUNCS_H
  
  #include "fmgr.h"
! #include "access/htup.h"
  #include "nodes/relation.h"
  
  
--- 16,22 ----
  #define SELFUNCS_H
  
  #include "fmgr.h"
! #include "access/tupbasics.h"
  #include "nodes/relation.h"
  
  
*** a/src/include/utils/snapmgr.h
--- b/src/include/utils/snapmgr.h
***************
*** 13,19 ****
--- 13,21 ----
  #ifndef SNAPMGR_H
  #define SNAPMGR_H
  
+ #include "fmgr.h"
  #include "utils/resowner.h"
+ #include "utils/snapshot.h"
  
  
  extern bool FirstSnapshotSet;
*** a/src/include/utils/snapshot.h
--- b/src/include/utils/snapshot.h
***************
*** 13,19 ****
  #ifndef SNAPSHOT_H
  #define SNAPSHOT_H
  
! #include "access/htup.h"
  #include "storage/buf.h"
  
  
--- 13,19 ----
  #ifndef SNAPSHOT_H
  #define SNAPSHOT_H
  
! #include "access/tupbasics.h"
  #include "storage/buf.h"
  
  
*** a/src/include/utils/syscache.h
--- b/src/include/utils/syscache.h
***************
*** 16,22 ****
  #ifndef SYSCACHE_H
  #define SYSCACHE_H
  
! #include "utils/catcache.h"
  
  /*
   *		SysCache identifiers.
--- 16,24 ----
  #ifndef SYSCACHE_H
  #define SYSCACHE_H
  
! #include "access/attnum.h"
! #include "access/tupbasics.h"
! /* we purposedly do not include utils/catcache.h here */
  
  /*
   *		SysCache identifiers.
***************
*** 119,124 **** extern uint32 GetSysCacheHashValue(int cacheId,
--- 121,127 ----
  					 Datum key1, Datum key2, Datum key3, Datum key4);
  
  /* list-search interface.  Users of this must import catcache.h too */
+ struct catclist;
  extern struct catclist *SearchSysCacheList(int cacheId, int nkeys,
  				   Datum key1, Datum key2, Datum key3, Datum key4);
  
*** a/src/pl/plperl/plperl.c
--- b/src/pl/plperl/plperl.c
***************
*** 16,21 ****
--- 16,22 ----
  #include <locale.h>
  
  /* postgreSQL stuff */
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/pg_language.h"
  #include "catalog/pg_proc.h"
*** a/src/pl/plpgsql/src/pl_comp.c
--- b/src/pl/plpgsql/src/pl_comp.c
***************
*** 17,22 ****
--- 17,23 ----
  
  #include <ctype.h>
  
+ #include "access/htup.h"
  #include "catalog/namespace.h"
  #include "catalog/pg_proc.h"
  #include "catalog/pg_proc_fn.h"
*** a/src/pl/plpgsql/src/pl_exec.c
--- b/src/pl/plpgsql/src/pl_exec.c
***************
*** 17,22 ****
--- 17,23 ----
  
  #include <ctype.h>
  
+ #include "access/htup.h"
  #include "access/transam.h"
  #include "access/tupconvert.h"
  #include "catalog/pg_proc.h"
*** a/src/pl/plpgsql/src/pl_handler.c
--- b/src/pl/plpgsql/src/pl_handler.c
***************
*** 15,20 ****
--- 15,21 ----
  
  #include "plpgsql.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_proc.h"
  #include "catalog/pg_type.h"
  #include "funcapi.h"
*** a/src/pl/plpython/plpy_exec.c
--- b/src/pl/plpython/plpy_exec.c
***************
*** 6,11 ****
--- 6,12 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/pg_type.h"
  #include "commands/trigger.h"
*** a/src/pl/plpython/plpy_main.c
--- b/src/pl/plpython/plpy_main.c
***************
*** 6,11 ****
--- 6,12 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "catalog/pg_proc.h"
  #include "catalog/pg_type.h"
  #include "commands/trigger.h"
*** a/src/pl/plpython/plpy_procedure.c
--- b/src/pl/plpython/plpy_procedure.c
***************
*** 6,11 ****
--- 6,12 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/transam.h"
  #include "funcapi.h"
  #include "catalog/pg_proc.h"
*** a/src/pl/plpython/plpy_spi.c
--- b/src/pl/plpython/plpy_spi.c
***************
*** 6,11 ****
--- 6,12 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/pg_type.h"
  #include "executor/spi_priv.h"
*** a/src/pl/plpython/plpy_typeio.c
--- b/src/pl/plpython/plpy_typeio.c
***************
*** 6,11 ****
--- 6,12 ----
  
  #include "postgres.h"
  
+ #include "access/htup.h"
  #include "access/transam.h"
  #include "catalog/pg_type.h"
  #include "funcapi.h"
*** a/src/pl/plpython/plpy_typeio.h
--- b/src/pl/plpython/plpy_typeio.h
***************
*** 5,11 ****
  #ifndef PLPY_TYPEIO_H
  #define PLPY_TYPEIO_H
  
! #include "access/htup.h"
  #include "fmgr.h"
  #include "storage/itemptr.h"
  
--- 5,12 ----
  #ifndef PLPY_TYPEIO_H
  #define PLPY_TYPEIO_H
  
! #include "access/tupbasics.h"
! #include "access/tupdesc.h"
  #include "fmgr.h"
  #include "storage/itemptr.h"
  
*** a/src/pl/tcl/pltcl.c
--- b/src/pl/tcl/pltcl.c
***************
*** 18,23 ****
--- 18,24 ----
  #define CONST84
  #endif
  
+ #include "access/htup.h"
  #include "access/xact.h"
  #include "catalog/pg_proc.h"
  #include "catalog/pg_type.h"
