Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Split out pg_operator.h function declarations to new file pg_operator_fn.h.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 Jan 2016 18:00:13 +0000 (13:00 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 Jan 2016 18:00:13 +0000 (13:00 -0500)
Commit a2e35b53c39b2a27 added an #include of catalog/objectaddress.h to
pg_operator.h, making it impossible for client-side code to #include
pg_operator.h.  It's not entirely clear whether any client-side code needs
to include pg_operator.h, but it seems prudent to assume that there is some
such code somewhere.  Therefore, split off the function definitions into a
new file pg_operator_fn.h, similarly to what we've done for some other
catalog header files.

Back-patch of part of commit 0dab5ef39b3d9d86.

src/backend/catalog/pg_operator.c
src/backend/commands/operatorcmds.c
src/include/catalog/pg_operator.h
src/include/catalog/pg_operator_fn.h [new file with mode: 0644]

index 072f530d988e945e26e7395814a5e44a50168f82..8137e8d9c3b22d6e131704dd5c69f6dfd0189b62 100644 (file)
@@ -26,6 +26,7 @@
 #include "catalog/objectaccess.h"
 #include "catalog/pg_namespace.h"
 #include "catalog/pg_operator.h"
+#include "catalog/pg_operator_fn.h"
 #include "catalog/pg_proc.h"
 #include "catalog/pg_type.h"
 #include "miscadmin.h"
index b4a1aac3a14f5a6292b0cbc6d0da574affa35b4b..2257c5625678bccf71bc5e216f450c45d5084549 100644 (file)
@@ -39,6 +39,7 @@
 #include "catalog/dependency.h"
 #include "catalog/indexing.h"
 #include "catalog/pg_operator.h"
+#include "catalog/pg_operator_fn.h"
 #include "catalog/pg_type.h"
 #include "commands/alter.h"
 #include "commands/defrem.h"
index eec9c60c505a3ec8611872cf52fbff46bee3330b..a8e041b95de3d772a4965583d19c229f856f2df8 100644 (file)
@@ -23,8 +23,6 @@
 #define PG_OPERATOR_H
 
 #include "catalog/genbki.h"
-#include "catalog/objectaddress.h"
-#include "nodes/pg_list.h"
 
 /* ----------------
  *     pg_operator definition.  cpp turns this into
@@ -1822,19 +1820,4 @@ DESCR("delete array element");
 DATA(insert OID = 3287 (  "#-"    PGNSP PGUID b f f 3802 1009 3802 0 0 jsonb_delete_path - - ));
 DESCR("delete path");
 
-/*
- * function prototypes
- */
-extern ObjectAddress OperatorCreate(const char *operatorName,
-              Oid operatorNamespace,
-              Oid leftTypeId,
-              Oid rightTypeId,
-              Oid procedureId,
-              List *commutatorName,
-              List *negatorName,
-              Oid restrictionId,
-              Oid joinId,
-              bool canMerge,
-              bool canHash);
-
 #endif   /* PG_OPERATOR_H */
diff --git a/src/include/catalog/pg_operator_fn.h b/src/include/catalog/pg_operator_fn.h
new file mode 100644 (file)
index 0000000..669c360
--- /dev/null
@@ -0,0 +1,32 @@
+/*-------------------------------------------------------------------------
+ *
+ * pg_operator_fn.h
+*   prototypes for functions in catalog/pg_operator.c
+ *
+ *
+ * Portions Copyright (c) 1996-2015, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/catalog/pg_operator_fn.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef PG_OPERATOR_FN_H
+#define PG_OPERATOR_FN_H
+
+#include "catalog/objectaddress.h"
+#include "nodes/pg_list.h"
+
+extern ObjectAddress OperatorCreate(const char *operatorName,
+              Oid operatorNamespace,
+              Oid leftTypeId,
+              Oid rightTypeId,
+              Oid procedureId,
+              List *commutatorName,
+              List *negatorName,
+              Oid restrictionId,
+              Oid joinId,
+              bool canMerge,
+              bool canHash);
+
+#endif   /* PG_OPERATOR_FN_H */