From f1312b5ed32630ae479e61e2a58cfac56ae46dd8 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Fri, 26 Aug 2011 21:16:24 -0400
Subject: [PATCH] Add postgres.h to *.c files for pg_upgrade, ltree, and
 btree_gist, and remove from local *.h files.

Per suggestion from Alvaro.
---
 contrib/btree_gist/btree_bit.c       | 2 ++
 contrib/btree_gist/btree_bytea.c     | 2 ++
 contrib/btree_gist/btree_cash.c      | 2 ++
 contrib/btree_gist/btree_date.c      | 2 ++
 contrib/btree_gist/btree_float4.c    | 2 ++
 contrib/btree_gist/btree_float8.c    | 2 ++
 contrib/btree_gist/btree_gist.c      | 2 ++
 contrib/btree_gist/btree_gist.h      | 1 -
 contrib/btree_gist/btree_inet.c      | 2 ++
 contrib/btree_gist/btree_int2.c      | 2 ++
 contrib/btree_gist/btree_int4.c      | 2 ++
 contrib/btree_gist/btree_int8.c      | 2 ++
 contrib/btree_gist/btree_interval.c  | 2 ++
 contrib/btree_gist/btree_macaddr.c   | 2 ++
 contrib/btree_gist/btree_numeric.c   | 2 ++
 contrib/btree_gist/btree_oid.c       | 2 ++
 contrib/btree_gist/btree_text.c      | 2 ++
 contrib/btree_gist/btree_time.c      | 2 ++
 contrib/btree_gist/btree_ts.c        | 2 ++
 contrib/btree_gist/btree_utils_num.c | 2 ++
 contrib/btree_gist/btree_utils_var.c | 2 ++
 contrib/ltree/crc32.c                | 2 ++
 contrib/ltree/ltree.h                | 1 -
 contrib/pg_upgrade/check.c           | 2 ++
 contrib/pg_upgrade/controldata.c     | 2 ++
 contrib/pg_upgrade/dump.c            | 2 ++
 contrib/pg_upgrade/exec.c            | 2 ++
 contrib/pg_upgrade/file.c            | 2 ++
 contrib/pg_upgrade/function.c        | 2 ++
 contrib/pg_upgrade/info.c            | 2 ++
 contrib/pg_upgrade/option.c          | 2 ++
 contrib/pg_upgrade/page.c            | 2 ++
 contrib/pg_upgrade/pg_upgrade.c      | 2 ++
 contrib/pg_upgrade/pg_upgrade.h      | 2 --
 contrib/pg_upgrade/relfilenode.c     | 2 ++
 contrib/pg_upgrade/server.c          | 2 ++
 contrib/pg_upgrade/tablespace.c      | 2 ++
 contrib/pg_upgrade/util.c            | 2 ++
 contrib/pg_upgrade/version.c         | 2 ++
 contrib/pg_upgrade/version_old_8_3.c | 2 ++
 40 files changed, 74 insertions(+), 4 deletions(-)

diff --git a/contrib/btree_gist/btree_bit.c b/contrib/btree_gist/btree_bit.c
index 8675d2488de..5c0d198b090 100644
--- a/contrib/btree_gist/btree_bit.c
+++ b/contrib/btree_gist/btree_bit.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_bit.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_var.h"
 #include "utils/bytea.h"
diff --git a/contrib/btree_gist/btree_bytea.c b/contrib/btree_gist/btree_bytea.c
index e45509d15ca..0dd441964a6 100644
--- a/contrib/btree_gist/btree_bytea.c
+++ b/contrib/btree_gist/btree_bytea.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_bytea.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_var.h"
 #include "utils/bytea.h"
diff --git a/contrib/btree_gist/btree_cash.c b/contrib/btree_gist/btree_cash.c
index 2664a268705..f22e1bff929 100644
--- a/contrib/btree_gist/btree_cash.c
+++ b/contrib/btree_gist/btree_cash.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_cash.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 #include "utils/cash.h"
diff --git a/contrib/btree_gist/btree_date.c b/contrib/btree_gist/btree_date.c
index 8a675e2f1d8..d6b989a177b 100644
--- a/contrib/btree_gist/btree_date.c
+++ b/contrib/btree_gist/btree_date.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_date.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 #include "utils/date.h"
diff --git a/contrib/btree_gist/btree_float4.c b/contrib/btree_gist/btree_float4.c
index 266256b23cf..e3f2155d593 100644
--- a/contrib/btree_gist/btree_float4.c
+++ b/contrib/btree_gist/btree_float4.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_float4.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 
diff --git a/contrib/btree_gist/btree_float8.c b/contrib/btree_gist/btree_float8.c
index efbee0f3e4b..0fbebeea077 100644
--- a/contrib/btree_gist/btree_float8.c
+++ b/contrib/btree_gist/btree_float8.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_float8.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 
diff --git a/contrib/btree_gist/btree_gist.c b/contrib/btree_gist/btree_gist.c
index 7e1c7e054cd..f2d2ed2cb28 100644
--- a/contrib/btree_gist/btree_gist.c
+++ b/contrib/btree_gist/btree_gist.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_gist.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 
 PG_MODULE_MAGIC;
diff --git a/contrib/btree_gist/btree_gist.h b/contrib/btree_gist/btree_gist.h
index 058a3f99e98..a6613039772 100644
--- a/contrib/btree_gist/btree_gist.h
+++ b/contrib/btree_gist/btree_gist.h
@@ -4,7 +4,6 @@
 #ifndef __BTREE_GIST_H__
 #define __BTREE_GIST_H__
 
-#include "postgres.h"
 #include "access/gist.h"
 #include "access/itup.h"
 #include "access/nbtree.h"
diff --git a/contrib/btree_gist/btree_inet.c b/contrib/btree_gist/btree_inet.c
index 690a01cbc7a..439e6c90a7c 100644
--- a/contrib/btree_gist/btree_inet.c
+++ b/contrib/btree_gist/btree_inet.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_inet.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 #include "utils/builtins.h"
diff --git a/contrib/btree_gist/btree_int2.c b/contrib/btree_gist/btree_int2.c
index 7841145b53f..3eb76b8be06 100644
--- a/contrib/btree_gist/btree_int2.c
+++ b/contrib/btree_gist/btree_int2.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_int2.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 
diff --git a/contrib/btree_gist/btree_int4.c b/contrib/btree_gist/btree_int4.c
index 0e4b4f85b0e..9e1362cc2f3 100644
--- a/contrib/btree_gist/btree_int4.c
+++ b/contrib/btree_gist/btree_int4.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_int4.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 
diff --git a/contrib/btree_gist/btree_int8.c b/contrib/btree_gist/btree_int8.c
index d54113d3936..45f5379a3e0 100644
--- a/contrib/btree_gist/btree_int8.c
+++ b/contrib/btree_gist/btree_int8.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_int8.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 
diff --git a/contrib/btree_gist/btree_interval.c b/contrib/btree_gist/btree_interval.c
index 137a5fcd7f4..b56494684f7 100644
--- a/contrib/btree_gist/btree_interval.c
+++ b/contrib/btree_gist/btree_interval.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_interval.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 #include "utils/timestamp.h"
diff --git a/contrib/btree_gist/btree_macaddr.c b/contrib/btree_gist/btree_macaddr.c
index aa150e26a23..2a223361b8d 100644
--- a/contrib/btree_gist/btree_macaddr.c
+++ b/contrib/btree_gist/btree_macaddr.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_macaddr.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 #include "utils/builtins.h"
diff --git a/contrib/btree_gist/btree_numeric.c b/contrib/btree_gist/btree_numeric.c
index e962c6dd327..37938aff6aa 100644
--- a/contrib/btree_gist/btree_numeric.c
+++ b/contrib/btree_gist/btree_numeric.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_numeric.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 
 #include <math.h>
diff --git a/contrib/btree_gist/btree_oid.c b/contrib/btree_gist/btree_oid.c
index 3b0929b42bb..7b4de5726dc 100644
--- a/contrib/btree_gist/btree_oid.c
+++ b/contrib/btree_gist/btree_oid.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_oid.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 
diff --git a/contrib/btree_gist/btree_text.c b/contrib/btree_gist/btree_text.c
index 3d4f8c13c86..277820dc0a6 100644
--- a/contrib/btree_gist/btree_text.c
+++ b/contrib/btree_gist/btree_text.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_text.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_var.h"
 #include "utils/builtins.h"
diff --git a/contrib/btree_gist/btree_time.c b/contrib/btree_gist/btree_time.c
index e9cfe33f455..c7f37d42302 100644
--- a/contrib/btree_gist/btree_time.c
+++ b/contrib/btree_gist/btree_time.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_time.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 #include "utils/date.h"
diff --git a/contrib/btree_gist/btree_ts.c b/contrib/btree_gist/btree_ts.c
index 9d3a5919a0e..4badb80bd2f 100644
--- a/contrib/btree_gist/btree_ts.c
+++ b/contrib/btree_gist/btree_ts.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_ts.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 #include "utils/builtins.h"
diff --git a/contrib/btree_gist/btree_utils_num.c b/contrib/btree_gist/btree_utils_num.c
index a3da5802df2..2b1252b78e2 100644
--- a/contrib/btree_gist/btree_utils_num.c
+++ b/contrib/btree_gist/btree_utils_num.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_utils_num.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 #include "btree_utils_num.h"
 #include "utils/cash.h"
diff --git a/contrib/btree_gist/btree_utils_var.c b/contrib/btree_gist/btree_utils_var.c
index e73799bb21c..9f8a132775b 100644
--- a/contrib/btree_gist/btree_utils_var.c
+++ b/contrib/btree_gist/btree_utils_var.c
@@ -1,6 +1,8 @@
 /*
  * contrib/btree_gist/btree_utils_var.c
  */
+#include "postgres.h"
+
 #include "btree_gist.h"
 
 #include <math.h>
diff --git a/contrib/ltree/crc32.c b/contrib/ltree/crc32.c
index c736defc73f..ea1a661fefb 100644
--- a/contrib/ltree/crc32.c
+++ b/contrib/ltree/crc32.c
@@ -2,6 +2,8 @@
 
 /* contrib/ltree/crc32.c */
 
+#include "postgres.h"
+
 #include <sys/types.h>
 #include <stdio.h>
 #include <sys/types.h>
diff --git a/contrib/ltree/ltree.h b/contrib/ltree/ltree.h
index 8e4ea4c1513..aec445847f9 100644
--- a/contrib/ltree/ltree.h
+++ b/contrib/ltree/ltree.h
@@ -3,7 +3,6 @@
 #ifndef __LTREE_H__
 #define __LTREE_H__
 
-#include "postgres.h"
 #include "fmgr.h"
 #include "tsearch/ts_locale.h"
 
diff --git a/contrib/pg_upgrade/check.c b/contrib/pg_upgrade/check.c
index 528b674b4f0..9690695fce8 100644
--- a/contrib/pg_upgrade/check.c
+++ b/contrib/pg_upgrade/check.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/check.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 
diff --git a/contrib/pg_upgrade/controldata.c b/contrib/pg_upgrade/controldata.c
index 1c64f39aa30..788c690c2a6 100644
--- a/contrib/pg_upgrade/controldata.c
+++ b/contrib/pg_upgrade/controldata.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/controldata.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 #include <ctype.h>
diff --git a/contrib/pg_upgrade/dump.c b/contrib/pg_upgrade/dump.c
index a07ab12d8f4..2af50bc8b5b 100644
--- a/contrib/pg_upgrade/dump.c
+++ b/contrib/pg_upgrade/dump.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/dump.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 
diff --git a/contrib/pg_upgrade/exec.c b/contrib/pg_upgrade/exec.c
index 2f5e76da2dc..ff9b3171090 100644
--- a/contrib/pg_upgrade/exec.c
+++ b/contrib/pg_upgrade/exec.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/exec.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 #include <fcntl.h>
diff --git a/contrib/pg_upgrade/file.c b/contrib/pg_upgrade/file.c
index fe897857676..e5d1613182b 100644
--- a/contrib/pg_upgrade/file.c
+++ b/contrib/pg_upgrade/file.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/file.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 #include <fcntl.h>
diff --git a/contrib/pg_upgrade/function.c b/contrib/pg_upgrade/function.c
index 53d562f3bd3..0f8008951ab 100644
--- a/contrib/pg_upgrade/function.c
+++ b/contrib/pg_upgrade/function.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/function.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 #include "access/transam.h"
diff --git a/contrib/pg_upgrade/info.c b/contrib/pg_upgrade/info.c
index 10188ca0f5e..5606486ef36 100644
--- a/contrib/pg_upgrade/info.c
+++ b/contrib/pg_upgrade/info.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/info.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 #include "access/transam.h"
diff --git a/contrib/pg_upgrade/option.c b/contrib/pg_upgrade/option.c
index 32bd3b896e2..bdb7ddb8590 100644
--- a/contrib/pg_upgrade/option.c
+++ b/contrib/pg_upgrade/option.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/option.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 #include "getopt_long.h"
diff --git a/contrib/pg_upgrade/page.c b/contrib/pg_upgrade/page.c
index d9e9f694d83..c8f57745a5f 100644
--- a/contrib/pg_upgrade/page.c
+++ b/contrib/pg_upgrade/page.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/page.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 #include "storage/bufpage.h"
diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c
index 4912f7727f6..0568acafb25 100644
--- a/contrib/pg_upgrade/pg_upgrade.c
+++ b/contrib/pg_upgrade/pg_upgrade.c
@@ -35,6 +35,8 @@
 
 
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 #ifdef HAVE_LANGINFO_H
diff --git a/contrib/pg_upgrade/pg_upgrade.h b/contrib/pg_upgrade/pg_upgrade.h
index a19b3df4393..feea324bd50 100644
--- a/contrib/pg_upgrade/pg_upgrade.h
+++ b/contrib/pg_upgrade/pg_upgrade.h
@@ -5,8 +5,6 @@
  *	contrib/pg_upgrade/pg_upgrade.h
  */
 
-#include "postgres.h"
-
 #include <unistd.h>
 #include <assert.h>
 #include <dirent.h>
diff --git a/contrib/pg_upgrade/relfilenode.c b/contrib/pg_upgrade/relfilenode.c
index df752c5fad0..9354d92d36c 100644
--- a/contrib/pg_upgrade/relfilenode.c
+++ b/contrib/pg_upgrade/relfilenode.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/relfilenode.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 #include "catalog/pg_class.h"
diff --git a/contrib/pg_upgrade/server.c b/contrib/pg_upgrade/server.c
index 17231da790e..f256e7f26e8 100644
--- a/contrib/pg_upgrade/server.c
+++ b/contrib/pg_upgrade/server.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/server.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 
diff --git a/contrib/pg_upgrade/tablespace.c b/contrib/pg_upgrade/tablespace.c
index 6cdae51cf19..08d227c10a0 100644
--- a/contrib/pg_upgrade/tablespace.c
+++ b/contrib/pg_upgrade/tablespace.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/tablespace.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 static void get_tablespace_paths(void);
diff --git a/contrib/pg_upgrade/util.c b/contrib/pg_upgrade/util.c
index 66c6acded0f..b7136be0452 100644
--- a/contrib/pg_upgrade/util.c
+++ b/contrib/pg_upgrade/util.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/util.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 #include <signal.h>
diff --git a/contrib/pg_upgrade/version.c b/contrib/pg_upgrade/version.c
index 46190b11543..58d2ae4ac93 100644
--- a/contrib/pg_upgrade/version.c
+++ b/contrib/pg_upgrade/version.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/version.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 #include "access/transam.h"
diff --git a/contrib/pg_upgrade/version_old_8_3.c b/contrib/pg_upgrade/version_old_8_3.c
index d63050c5b51..55d919cf072 100644
--- a/contrib/pg_upgrade/version_old_8_3.c
+++ b/contrib/pg_upgrade/version_old_8_3.c
@@ -7,6 +7,8 @@
  *	contrib/pg_upgrade/version_old_8_3.c
  */
 
+#include "postgres.h"
+
 #include "pg_upgrade.h"
 
 #include "access/transam.h"
-- 
GitLab