]> granicus.if.org Git - postgresql/commitdiff
Split builtins.h to a new header ruleutils.h
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 8 Oct 2014 21:10:47 +0000 (18:10 -0300)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Wed, 8 Oct 2014 21:10:47 +0000 (18:10 -0300)
The new header contains many prototypes for functions in ruleutils.c
that are not exposed to the SQL level.

Reviewed by Andres Freund and Michael Paquier.

src/backend/access/index/genam.c
src/backend/catalog/heap.c
src/backend/commands/explain.c
src/backend/commands/tablecmds.c
src/backend/commands/typecmds.c
src/backend/utils/adt/misc.c
src/backend/utils/adt/ruleutils.c
src/include/utils/builtins.h
src/include/utils/ruleutils.h [new file with mode: 0644]

index 850008b3407bf76a4024974cad03eb96d2692489..8849c08e548ff12bd7f4a5a440fdba9b35182bde 100644 (file)
@@ -28,6 +28,7 @@
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
 #include "utils/rel.h"
+#include "utils/ruleutils.h"
 #include "utils/snapmgr.h"
 #include "utils/tqual.h"
 
index 55c1e79563b3e36d65c5777066e0eba2b2910be2..c0eade0a3d734f51b7b632f1824d03dc045197c8 100644 (file)
@@ -69,6 +69,7 @@
 #include "utils/inval.h"
 #include "utils/lsyscache.h"
 #include "utils/rel.h"
+#include "utils/ruleutils.h"
 #include "utils/snapmgr.h"
 #include "utils/syscache.h"
 #include "utils/tqual.h"
index 781a736115a41103468de9bcf8b02b600ee872cb..49963ff429d75803647005c5d87eda6a4c7300f6 100644 (file)
@@ -28,6 +28,7 @@
 #include "utils/json.h"
 #include "utils/lsyscache.h"
 #include "utils/rel.h"
+#include "utils/ruleutils.h"
 #include "utils/snapmgr.h"
 #include "utils/tuplesort.h"
 #include "utils/xml.h"
index cb16c53a607a18712280c94d81df0df4aab52e05..d9263e320bcf09d00f6a97730654026ecefc8f8f 100644 (file)
@@ -85,6 +85,7 @@
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
 #include "utils/relcache.h"
+#include "utils/ruleutils.h"
 #include "utils/snapmgr.h"
 #include "utils/syscache.h"
 #include "utils/tqual.h"
index ad364efbcbd5e15654308142a25185e2fe4d1d47..55a68810f23f51ac09e5685fb770929dba5ea985 100644 (file)
@@ -72,6 +72,7 @@
 #include "utils/lsyscache.h"
 #include "utils/memutils.h"
 #include "utils/rel.h"
+#include "utils/ruleutils.h"
 #include "utils/snapmgr.h"
 #include "utils/syscache.h"
 #include "utils/tqual.h"
index 4eeb6314faecbcaafa2b92b4efac2dfc568028d4..67539ecde92fe2061bfc87447d9aa168ce24119f 100644 (file)
@@ -35,6 +35,7 @@
 #include "storage/proc.h"
 #include "storage/procarray.h"
 #include "utils/lsyscache.h"
+#include "utils/ruleutils.h"
 #include "tcop/tcopprot.h"
 #include "utils/builtins.h"
 #include "utils/timestamp.h"
index 6e41cbd142f024cdd48b99bba7a94fa740f07bcd..24ade6cc201a5ae637e66ab292e7a359ea706d5e 100644 (file)
@@ -55,6 +55,7 @@
 #include "utils/fmgroids.h"
 #include "utils/lsyscache.h"
 #include "utils/rel.h"
+#include "utils/ruleutils.h"
 #include "utils/snapmgr.h"
 #include "utils/syscache.h"
 #include "utils/tqual.h"
index d88e7a3b265821566adf08c7ca69176dfc1ddbe2..fb1b4a42ddb68f05de1ed89ab873d6fa5a42bc4e 100644 (file)
@@ -676,13 +676,10 @@ extern Datum pg_get_viewdef_name(PG_FUNCTION_ARGS);
 extern Datum pg_get_viewdef_name_ext(PG_FUNCTION_ARGS);
 extern Datum pg_get_indexdef(PG_FUNCTION_ARGS);
 extern Datum pg_get_indexdef_ext(PG_FUNCTION_ARGS);
-extern char *pg_get_indexdef_string(Oid indexrelid);
-extern char *pg_get_indexdef_columns(Oid indexrelid, bool pretty);
 extern Datum pg_get_triggerdef(PG_FUNCTION_ARGS);
 extern Datum pg_get_triggerdef_ext(PG_FUNCTION_ARGS);
 extern Datum pg_get_constraintdef(PG_FUNCTION_ARGS);
 extern Datum pg_get_constraintdef_ext(PG_FUNCTION_ARGS);
-extern char *pg_get_constraintdef_string(Oid constraintId);
 extern Datum pg_get_expr(PG_FUNCTION_ARGS);
 extern Datum pg_get_expr_ext(PG_FUNCTION_ARGS);
 extern Datum pg_get_userbyid(PG_FUNCTION_ARGS);
@@ -692,17 +689,9 @@ extern Datum pg_get_function_arguments(PG_FUNCTION_ARGS);
 extern Datum pg_get_function_identity_arguments(PG_FUNCTION_ARGS);
 extern Datum pg_get_function_result(PG_FUNCTION_ARGS);
 extern Datum pg_get_function_arg_default(PG_FUNCTION_ARGS);
-extern char *deparse_expression(Node *expr, List *dpcontext,
-                                  bool forceprefix, bool showimplicit);
-extern List *deparse_context_for(const char *aliasname, Oid relid);
-extern List *deparse_context_for_planstate(Node *planstate, List *ancestors,
-                                                         List *rtable, List *rtable_names);
-extern List *select_rtable_names_for_explain(List *rtable,
-                                                               Bitmapset *rels_used);
 extern const char *quote_identifier(const char *ident);
 extern char *quote_qualified_identifier(const char *qualifier,
                                                   const char *ident);
-extern char *generate_collation_name(Oid collid);
 
 
 /* tid.c */
diff --git a/src/include/utils/ruleutils.h b/src/include/utils/ruleutils.h
new file mode 100644 (file)
index 0000000..520b066
--- /dev/null
@@ -0,0 +1,34 @@
+/*-------------------------------------------------------------------------
+ *
+ * ruleutils.h
+ *             Declarations for ruleutils.c
+ *
+ * Portions Copyright (c) 1996-2014, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * src/include/ruleutils.h
+ *
+ *-------------------------------------------------------------------------
+ */
+#ifndef RULEUTILS_H
+#define RULEUTILS_H
+
+#include "nodes/nodes.h"
+#include "nodes/parsenodes.h"
+#include "nodes/pg_list.h"
+
+
+extern char *pg_get_indexdef_string(Oid indexrelid);
+extern char *pg_get_indexdef_columns(Oid indexrelid, bool pretty);
+
+extern char *pg_get_constraintdef_string(Oid constraintId);
+extern char *deparse_expression(Node *expr, List *dpcontext,
+                                  bool forceprefix, bool showimplicit);
+extern List *deparse_context_for(const char *aliasname, Oid relid);
+extern List *deparse_context_for_planstate(Node *planstate, List *ancestors,
+                                                         List *rtable, List *rtable_names);
+extern List *select_rtable_names_for_explain(List *rtable,
+                                                               Bitmapset *rels_used);
+extern char *generate_collation_name(Oid collid);
+
+#endif /* RULEUTILS_H */