Fix executor/spi.h to follow our usual conventions for include files, ie,
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 7 Jan 2009 13:44:37 +0000 (13:44 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 7 Jan 2009 13:44:37 +0000 (13:44 +0000)
not include postgres.h nor anything else it doesn't directly need.  Add
#includes to calling files as needed to compensate.  Per my proposal of
yesterday.

This should be noted as a source code change in the 8.4 release notes,
since it's likely to require changes in add-on modules.

22 files changed:
contrib/spi/autoinc.c
contrib/spi/insert_username.c
contrib/spi/moddatetime.c
contrib/spi/refint.c
contrib/spi/timetravel.c
contrib/tablefunc/tablefunc.c
contrib/xml2/xpath.c
contrib/xml2/xslt_proc.c
doc/src/sgml/spi.sgml
src/backend/executor/spi.c
src/backend/utils/adt/ri_triggers.c
src/backend/utils/adt/ruleutils.c
src/backend/utils/adt/tsquery_rewrite.c
src/backend/utils/adt/tsvector_op.c
src/backend/utils/adt/xml.c
src/include/executor/spi.h
src/pl/plperl/plperl.c
src/pl/plpgsql/src/gram.y
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/plpgsql.h
src/pl/tcl/pltcl.c
src/test/regress/regress.c

index cd34a9ac24633fe8893abeee3ad4e3dea4515333..42d52bd2a47911733978a28d7ecd08d385cf3122 100644 (file)
@@ -1,10 +1,13 @@
 /*
- * $PostgreSQL:
+ * $PostgreSQL$ 
  */
+#include "postgres.h"
 
-#include "executor/spi.h"              /* this is what you need to work with SPI */
-#include "commands/trigger.h"  /* -"- and triggers */
-#include "commands/sequence.h" /* for nextval() */
+#include "catalog/pg_type.h"
+#include "commands/sequence.h"
+#include "commands/trigger.h"
+#include "executor/spi.h"
+#include "utils/builtins.h"
 
 PG_MODULE_MAGIC;
 
index 133131d74c67e096dd2bfe7951388afa3b9c9027..01c0ad2afbd8bc03574ef2b862a26319b552160b 100644 (file)
@@ -6,10 +6,13 @@
  * insert user name in response to a trigger
  * usage:  insert_username (column_name)
  */
+#include "postgres.h"
 
-#include "executor/spi.h"              /* this is what you need to work with SPI */
-#include "commands/trigger.h"  /* -"- and triggers */
-#include "miscadmin.h"                 /* for GetUserName() */
+#include "catalog/pg_type.h"
+#include "commands/trigger.h"
+#include "executor/spi.h"
+#include "miscadmin.h"
+#include "utils/builtins.h"
 
 PG_MODULE_MAGIC;
 
index b42dcaa48cd9f975bd552c0abdebffc48f6ff1b4..1466c2a9c23465f5d3ecb31c23f7d4e02da03304 100644 (file)
@@ -13,9 +13,11 @@ not really know what I am doing.  I also had help from
 Jan Wieck <jwieck@debis.com> who told me about the timestamp_in("now") function.
 OH, me, I'm Terry Mackintosh <terry@terrym.com>
 */
+#include "postgres.h"
 
-#include "executor/spi.h"              /* this is what you need to work with SPI */
-#include "commands/trigger.h"  /* -"- and triggers */
+#include "catalog/pg_type.h"
+#include "executor/spi.h"
+#include "commands/trigger.h"
 
 PG_MODULE_MAGIC;
 
index b30687a15ba9c564d0b2fa742d19d59b9f11c8e8..dee48f0708c9841e767863100ac091d4bdf69b65 100644 (file)
@@ -1,16 +1,17 @@
 /*
- * $PostgreSQL:
+ * $PostgreSQL$ 
  *
  *
  * refint.c -- set of functions to define referential integrity
  *             constraints using general triggers.
  */
+#include "postgres.h"
 
-#include "executor/spi.h"              /* this is what you need to work with SPI */
-
-#include "commands/trigger.h"  /* -"- and triggers */
 #include <ctype.h>
 
+#include "commands/trigger.h"
+#include "executor/spi.h"
+#include "utils/builtins.h"
 
 PG_MODULE_MAGIC;
 
index dc900d182d284915e98d82fa5687d24634635c42..f163bdfa305b8231148c612a3ecc43cddf803f7f 100644 (file)
@@ -1,22 +1,23 @@
 /*
- * $PostgreSQL:
+ * $PostgreSQL$ 
  *
  *
  * timetravel.c --     function to get time travel feature
  *             using general triggers.
+ *
+ * Modified by BÖJTHE Zoltán, Hungary, mailto:urdesobt@axelero.hu
  */
+#include "postgres.h"
 
-/* Modified by BÖJTHE Zoltán, Hungary, mailto:urdesobt@axelero.hu */
+#include <ctype.h>
 
-#include "executor/spi.h"              /* this is what you need to work with SPI */
-#include "commands/trigger.h"  /* -"- and triggers */
-#include "miscadmin.h"                 /* for GetPgUserName() */
+#include "catalog/pg_type.h"
+#include "commands/trigger.h"
+#include "executor/spi.h"
+#include "miscadmin.h"
+#include "utils/builtins.h"
 #include "utils/nabstime.h"
 
-#include <ctype.h>                             /* tolower () */
-
-#define ABSTIMEOID     702                     /* it should be in pg_type.h */
-
 PG_MODULE_MAGIC;
 
 /* AbsoluteTime currabstime(void); */
index 9d17352de68becdc3c400d103041f773562656c9..3e5e90fe8183e25c163c31c88bfd32daf9ffe13c 100644 (file)
@@ -34,6 +34,7 @@
 
 #include <math.h>
 
+#include "catalog/pg_type.h"
 #include "fmgr.h"
 #include "funcapi.h"
 #include "executor/spi.h"
index 6a7c64afbdd247aebd4559d560ace6631b0f1038..01fa91bf00838fab790a80ba85ad82a7053743b2 100644 (file)
@@ -1,15 +1,17 @@
 /*
- * $PostgreSQL$ 
+ * $PostgreSQL$
  *
  * Parser interface for DOM-based parser (libxml) rather than
-   stream-based SAX-type parser */
-
+ * stream-based SAX-type parser
+ */
 #include "postgres.h"
-#include "fmgr.h"
+
 #include "executor/spi.h"
+#include "fmgr.h"
 #include "funcapi.h"
-#include "miscadmin.h"
 #include "lib/stringinfo.h"
+#include "miscadmin.h"
+#include "utils/builtins.h"
 
 /* libxml includes */
 
index c653c642c68bd7dffb619837e28a8a0f7c8b90c1..4f96164ff5781fcf46f0505ff7448715ca9c3798 100644 (file)
@@ -1,14 +1,17 @@
 /*
- * $PostgreSQL:
+ * $PostgreSQL$ 
  *
- * XSLT processing functions (requiring libxslt) */
-/* John Gray, for Torchbox 2003-04-01 */
-
+ * XSLT processing functions (requiring libxslt)
+ *
+ * John Gray, for Torchbox 2003-04-01
+ */
 #include "postgres.h"
-#include "fmgr.h"
+
 #include "executor/spi.h"
+#include "fmgr.h"
 #include "funcapi.h"
 #include "miscadmin.h"
+#include "utils/builtins.h"
 
 /* libxml includes */
 
index f027d15988908d6a55e5c587511e83a88fa5aac4..248564f92b3b34abbde939eabf1f873b6634fa55 100644 (file)
@@ -3617,7 +3617,10 @@ INSERT INTO a SELECT * FROM a;
   </para>
 
 <programlisting>
+#include "postgres.h"
+
 #include "executor/spi.h"
+#include "utils/builtins.h"
 
 #ifdef PG_MODULE_MAGIC
 PG_MODULE_MAGIC;
index 4bb12b28e7eb73966aa43dbfe4430da065e952cc..3a3fd5962f1e95fecf78b843b96682308f44fc05 100644 (file)
 
 #include "access/printtup.h"
 #include "access/sysattr.h"
+#include "access/xact.h"
 #include "catalog/heap.h"
+#include "catalog/pg_type.h"
 #include "commands/trigger.h"
+#include "executor/executor.h"
 #include "executor/spi_priv.h"
+#include "tcop/pquery.h"
+#include "tcop/utility.h"
+#include "utils/builtins.h"
+#include "utils/datum.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
 #include "utils/snapmgr.h"
+#include "utils/syscache.h"
 #include "utils/typcache.h"
 
 
index fa8b889a53a4dc6b245cb19496e0875eee3ece76..76a12f5cf9f8b991abda1487cec5f880a22dd732 100644 (file)
 
 #include "postgres.h"
 
+#include "access/xact.h"
 #include "catalog/pg_constraint.h"
 #include "catalog/pg_operator.h"
+#include "catalog/pg_type.h"
 #include "commands/trigger.h"
 #include "executor/spi.h"
 #include "parser/parse_coerce.h"
 #include "parser/parse_relation.h"
 #include "miscadmin.h"
 #include "utils/acl.h"
+#include "utils/builtins.h"
 #include "utils/fmgroids.h"
+#include "utils/guc.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
 #include "utils/snapmgr.h"
+#include "utils/syscache.h"
 #include "utils/tqual.h"
 
 
index 7a9f8280af86cdaf8497e611114d6fa8bca42e9a..35de97291875b16911696d632e6124d0435ca4f3 100644 (file)
 #include "catalog/pg_authid.h"
 #include "catalog/pg_constraint.h"
 #include "catalog/pg_depend.h"
+#include "catalog/pg_language.h"
 #include "catalog/pg_opclass.h"
 #include "catalog/pg_operator.h"
+#include "catalog/pg_proc.h"
 #include "catalog/pg_trigger.h"
+#include "catalog/pg_type.h"
 #include "commands/defrem.h"
 #include "commands/tablespace.h"
 #include "executor/spi.h"
 #include "rewrite/rewriteHandler.h"
 #include "rewrite/rewriteManip.h"
 #include "rewrite/rewriteSupport.h"
+#include "utils/array.h"
+#include "utils/builtins.h"
 #include "utils/fmgroids.h"
 #include "utils/lsyscache.h"
 #include "utils/tqual.h"
+#include "utils/syscache.h"
 #include "utils/typcache.h"
 #include "utils/xml.h"
 
index 01509b55359274b406811cce27bcdc37e2b6aa7d..3df9eca646613d7a980399b1a2ea3047ee9c018b 100644 (file)
 
 #include "postgres.h"
 
+#include "catalog/pg_type.h"
 #include "executor/spi.h"
+#include "miscadmin.h"
 #include "tsearch/ts_type.h"
 #include "tsearch/ts_utils.h"
-#include "miscadmin.h"
+#include "utils/builtins.h"
 
 
 static int
index 015a036d8354cbc823c312695125b481b2224159..4534175fcdf18e96ddff30ec11a54649043b74b0 100644 (file)
@@ -15,6 +15,7 @@
 #include "postgres.h"
 
 #include "catalog/namespace.h"
+#include "catalog/pg_type.h"
 #include "commands/trigger.h"
 #include "executor/spi.h"
 #include "funcapi.h"
index c71cff95f642e006ef73201f1c192c65ddd8610b..5fa5f0b928b950f1654813013dc83163c0d45995 100644 (file)
@@ -81,6 +81,7 @@
 #include "utils/datetime.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
+#include "utils/syscache.h"
 #include "utils/xml.h"
 
 
index a79171aa114d2c827a51a8c7c891d61925cafebb..cf331d5147c4cb0f43f1364cfaa97be3b1a9c002 100644 (file)
 #ifndef SPI_H
 #define SPI_H
 
-/*
- * This file may be used by client modules that haven't already
- * included postgres.h
- */
-#include "postgres.h"
-
-/*
- *     Most of these are not needed by this file, but may be used by
- *     user-written code that uses SPI
- */
-#include "access/heapam.h"
-#include "access/xact.h"
-#include "catalog/pg_language.h"
-#include "catalog/pg_proc.h"
-#include "catalog/pg_type.h"
-#include "executor/execdefs.h"
-#include "executor/executor.h"
-#include "nodes/execnodes.h"
-#include "nodes/params.h"
 #include "nodes/parsenodes.h"
-#include "nodes/plannodes.h"
-#include "nodes/primnodes.h"
-#include "nodes/relation.h"
-#include "tcop/dest.h"
-#include "tcop/pquery.h"
-#include "tcop/tcopprot.h"
-#include "tcop/utility.h"
-#include "utils/builtins.h"
-#include "utils/datum.h"
 #include "utils/portal.h"
-#include "utils/syscache.h"
+#include "utils/relcache.h"
+#include "utils/snapshot.h"
 
 
 typedef struct SPITupleTable
index 20bd969aea2dff2607d324604238adf7b52cc8cc..5f33ca6e47efc026d601145aa7da4591e79f299d 100644 (file)
 #include <locale.h>
 
 /* postgreSQL stuff */
+#include "access/xact.h"
+#include "catalog/pg_language.h"
+#include "catalog/pg_proc.h"
+#include "catalog/pg_type.h"
 #include "commands/trigger.h"
 #include "executor/spi.h"
 #include "funcapi.h"
 #include "miscadmin.h"
 #include "nodes/makefuncs.h"
 #include "parser/parse_type.h"
+#include "utils/builtins.h"
 #include "utils/fmgroids.h"
 #include "utils/guc.h"
+#include "utils/hsearch.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
+#include "utils/syscache.h"
 #include "utils/typcache.h"
-#include "utils/hsearch.h"
 
 /* define our text domain for translations */
 #undef TEXTDOMAIN
index 85b874924643ed3a03f428fc799192b75f2c8a1a..0fec4e1dd7af21c42055213087a94f927f1e9080 100644 (file)
@@ -16,6 +16,7 @@
 
 #include "plpgsql.h"
 
+#include "catalog/pg_type.h"
 #include "parser/parser.h"
 
 
index a82321a30ab07ae111698350f412453565d7c131..13099e6ba88e53ac6f8e311df19bf96e750fa9ef 100644 (file)
@@ -27,6 +27,7 @@
 #include "tcop/tcopprot.h"
 #include "utils/array.h"
 #include "utils/builtins.h"
+#include "utils/datum.h"
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
 #include "utils/snapmgr.h"
index 1b13da2499f42128b0f70bc6dbe7f7295ef85698..6360393362ca8b1b21abd6d5e2f26cbbc2544834 100644 (file)
@@ -18,6 +18,7 @@
 
 #include "postgres.h"
 
+#include "access/xact.h"
 #include "fmgr.h"
 #include "miscadmin.h"
 #include "commands/trigger.h"
index fc586539fe312fa43a6d729c3a99c3ebe71b9f49..fb67f41e8ba3caab1641fa4a4b1bd7bc348e01a7 100644 (file)
 #define CONST84
 #endif
 
+#include "access/xact.h"
 #include "catalog/pg_language.h"
 #include "catalog/pg_proc.h"
+#include "catalog/pg_type.h"
 #include "commands/trigger.h"
 #include "executor/spi.h"
 #include "fmgr.h"
@@ -33,6 +35,7 @@
 #include "utils/syscache.h"
 #include "utils/typcache.h"
 
+
 #define HAVE_TCL_VERSION(maj,min) \
        ((TCL_MAJOR_VERSION > maj) || \
         (TCL_MAJOR_VERSION == maj && TCL_MINOR_VERSION >= min))
index 601c687a4fc4a4ef8a87025a9790d4f0bc38a011..0e94e681b2017826f02e55da5ca963a84a7e960d 100644 (file)
@@ -4,12 +4,19 @@
 
 #include "postgres.h"
 
-#include <float.h>                             /* faked on sunos */
+#include <float.h>
+#include <math.h>
 
 #include "access/transam.h"
-#include "utils/geo_decls.h"   /* includes <math.h> */
-#include "executor/executor.h" /* For GetAttributeByName */
-#include "commands/sequence.h" /* for nextval() */
+#include "access/xact.h"
+#include "catalog/pg_type.h"
+#include "commands/sequence.h"
+#include "commands/trigger.h"
+#include "executor/executor.h"
+#include "executor/spi.h"
+#include "utils/builtins.h"
+#include "utils/geo_decls.h"
+
 
 #define P_MAXDIG 12
 #define LDELIM                 '('
@@ -325,8 +332,6 @@ oldstyle_length(int n, text *t)
        return n + len;
 }
 
-#include "executor/spi.h"              /* this is what you need to work with SPI */
-#include "commands/trigger.h"  /* -"- and triggers */
 
 static TransactionId fd17b_xid = InvalidTransactionId;
 static TransactionId fd17a_xid = InvalidTransactionId;