summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorTom Lane2009-01-07 13:44:37 +0000
committerTom Lane2009-01-07 13:44:37 +0000
commit1cfd9e88349fc259d17914ccfd4eaf7bb7f7d141 (patch)
treed1a204c32625761f4c36cc02bf9a83af32eb8748 /contrib
parentb09f930d2eec6ed2427786d9aa64c1206859774d (diff)
Fix executor/spi.h to follow our usual conventions for include files, ie,
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.
Diffstat (limited to 'contrib')
-rw-r--r--contrib/spi/autoinc.c11
-rw-r--r--contrib/spi/insert_username.c11
-rw-r--r--contrib/spi/moddatetime.c8
-rw-r--r--contrib/spi/refint.c9
-rw-r--r--contrib/spi/timetravel.c19
-rw-r--r--contrib/tablefunc/tablefunc.c3
-rw-r--r--contrib/xml2/xpath.c12
-rw-r--r--contrib/xml2/xslt_proc.c13
8 files changed, 51 insertions, 35 deletions
diff --git a/contrib/spi/autoinc.c b/contrib/spi/autoinc.c
index bc39db00c26..f5554146648 100644
--- a/contrib/spi/autoinc.c
+++ b/contrib/spi/autoinc.c
@@ -1,10 +1,13 @@
/*
- * $PostgreSQL: pgsql/contrib/spi/autoinc.c,v 1.15 2008/05/17 01:28:22 adunstan Exp $
+ * $PostgreSQL: pgsql/contrib/spi/autoinc.c,v 1.16 2009/01/07 13:44:36 tgl Exp $
*/
+#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;
diff --git a/contrib/spi/insert_username.c b/contrib/spi/insert_username.c
index 9541677ebde..377284a6133 100644
--- a/contrib/spi/insert_username.c
+++ b/contrib/spi/insert_username.c
@@ -1,15 +1,18 @@
/*
* insert_username.c
* $Modified: Thu Oct 16 08:13:42 1997 by brook $
- * $PostgreSQL: pgsql/contrib/spi/insert_username.c,v 1.16 2008/03/25 22:42:42 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/spi/insert_username.c,v 1.17 2009/01/07 13:44:36 tgl Exp $
*
* 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;
diff --git a/contrib/spi/moddatetime.c b/contrib/spi/moddatetime.c
index b4c9fe4de96..0b4d3ba3519 100644
--- a/contrib/spi/moddatetime.c
+++ b/contrib/spi/moddatetime.c
@@ -1,7 +1,7 @@
/*
moddatetime.c
-$PostgreSQL: pgsql/contrib/spi/moddatetime.c,v 1.14 2007/02/01 19:10:23 momjian Exp $
+$PostgreSQL: pgsql/contrib/spi/moddatetime.c,v 1.15 2009/01/07 13:44:36 tgl Exp $
What is this?
It is a function to be called from a trigger for the purpose of updating
@@ -13,9 +13,11 @@ not really know what I am doing. I also had help from
Jan Wieck <[email protected]> who told me about the timestamp_in("now") function.
OH, me, I'm Terry Mackintosh <[email protected]>
*/
+#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;
diff --git a/contrib/spi/refint.c b/contrib/spi/refint.c
index dd628e7be3e..aaef7b4977b 100644
--- a/contrib/spi/refint.c
+++ b/contrib/spi/refint.c
@@ -1,16 +1,17 @@
/*
- * $PostgreSQL: pgsql/contrib/spi/refint.c,v 1.33 2008/05/17 01:28:22 adunstan Exp $
+ * $PostgreSQL: pgsql/contrib/spi/refint.c,v 1.34 2009/01/07 13:44:36 tgl Exp $
*
*
* 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;
diff --git a/contrib/spi/timetravel.c b/contrib/spi/timetravel.c
index a0a1b22923f..a949d2d8179 100644
--- a/contrib/spi/timetravel.c
+++ b/contrib/spi/timetravel.c
@@ -1,22 +1,23 @@
/*
- * $PostgreSQL: pgsql/contrib/spi/timetravel.c,v 1.29 2008/05/17 01:28:22 adunstan Exp $
+ * $PostgreSQL: pgsql/contrib/spi/timetravel.c,v 1.30 2009/01/07 13:44:36 tgl Exp $
*
*
* timetravel.c -- function to get time travel feature
* using general triggers.
+ *
+ * Modified by B�JTHE Zolt�n, Hungary, mailto:[email protected]
*/
+#include "postgres.h"
-/* Modified by B�JTHE Zolt�n, Hungary, mailto:[email protected] */
+#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); */
diff --git a/contrib/tablefunc/tablefunc.c b/contrib/tablefunc/tablefunc.c
index dc7924733c7..5829c841112 100644
--- a/contrib/tablefunc/tablefunc.c
+++ b/contrib/tablefunc/tablefunc.c
@@ -1,5 +1,5 @@
/*
- * $PostgreSQL: pgsql/contrib/tablefunc/tablefunc.c,v 1.58 2009/01/01 17:23:32 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/tablefunc/tablefunc.c,v 1.59 2009/01/07 13:44:36 tgl Exp $
*
*
* tablefunc
@@ -34,6 +34,7 @@
#include <math.h>
+#include "catalog/pg_type.h"
#include "fmgr.h"
#include "funcapi.h"
#include "executor/spi.h"
diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c
index b2f3342f737..d5244a1ce34 100644
--- a/contrib/xml2/xpath.c
+++ b/contrib/xml2/xpath.c
@@ -1,15 +1,17 @@
/*
- * $PostgreSQL: pgsql/contrib/xml2/xpath.c,v 1.21 2008/10/29 00:00:38 tgl Exp $
+ * $PostgreSQL: pgsql/contrib/xml2/xpath.c,v 1.22 2009/01/07 13:44:36 tgl Exp $
*
* 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 */
diff --git a/contrib/xml2/xslt_proc.c b/contrib/xml2/xslt_proc.c
index 425a9393337..4ca176ed2ec 100644
--- a/contrib/xml2/xslt_proc.c
+++ b/contrib/xml2/xslt_proc.c
@@ -1,14 +1,17 @@
/*
- * $PostgreSQL: pgsql/contrib/xml2/xslt_proc.c,v 1.13 2008/05/17 01:28:22 adunstan Exp $
+ * $PostgreSQL: pgsql/contrib/xml2/xslt_proc.c,v 1.14 2009/01/07 13:44:36 tgl Exp $
*
- * 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 */