PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
nodeFuncs.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * nodeFuncs.h
4  * Various general-purpose manipulations of Node trees
5  *
6  * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/nodes/nodeFuncs.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef NODEFUNCS_H
14 #define NODEFUNCS_H
15 
16 #include "nodes/parsenodes.h"
17 
18 
19 /* flags bits for query_tree_walker and query_tree_mutator */
20 #define QTW_IGNORE_RT_SUBQUERIES 0x01 /* subqueries in rtable */
21 #define QTW_IGNORE_CTE_SUBQUERIES 0x02 /* subqueries in cteList */
22 #define QTW_IGNORE_RC_SUBQUERIES 0x03 /* both of above */
23 #define QTW_IGNORE_JOINALIASES 0x04 /* JOIN alias var lists */
24 #define QTW_IGNORE_RANGE_TABLE 0x08 /* skip rangetable entirely */
25 #define QTW_EXAMINE_RTES 0x10 /* examine RTEs */
26 #define QTW_DONT_COPY_QUERY 0x20 /* do not copy top Query */
27 
28 
29 extern Oid exprType(const Node *expr);
30 extern int32 exprTypmod(const Node *expr);
31 extern bool exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod);
32 extern Node *relabel_to_typmod(Node *expr, int32 typmod);
33 extern Node *strip_implicit_coercions(Node *node);
34 extern bool expression_returns_set(Node *clause);
35 
36 extern Oid exprCollation(const Node *expr);
37 extern Oid exprInputCollation(const Node *expr);
38 extern void exprSetCollation(Node *expr, Oid collation);
39 extern void exprSetInputCollation(Node *expr, Oid inputcollation);
40 
41 extern int exprLocation(const Node *expr);
42 
43 extern bool expression_tree_walker(Node *node, bool (*walker) (),
44  void *context);
45 extern Node *expression_tree_mutator(Node *node, Node *(*mutator) (),
46  void *context);
47 
48 extern bool query_tree_walker(Query *query, bool (*walker) (),
49  void *context, int flags);
50 extern Query *query_tree_mutator(Query *query, Node *(*mutator) (),
51  void *context, int flags);
52 
53 extern bool range_table_walker(List *rtable, bool (*walker) (),
54  void *context, int flags);
55 extern List *range_table_mutator(List *rtable, Node *(*mutator) (),
56  void *context, int flags);
57 
58 extern bool query_or_expression_tree_walker(Node *node, bool (*walker) (),
59  void *context, int flags);
60 extern Node *query_or_expression_tree_mutator(Node *node, Node *(*mutator) (),
61  void *context, int flags);
62 
63 extern bool raw_expression_tree_walker(Node *node, bool (*walker) (),
64  void *context);
65 
66 struct PlanState;
67 extern bool planstate_tree_walker(struct PlanState *planstate, bool (*walker) (),
68  void *context);
69 
70 #endif /* NODEFUNCS_H */
Query * query_tree_mutator(Query *query, Node *(*mutator)(), void *context, int flags)
Definition: nodeFuncs.c:2840
Node * relabel_to_typmod(Node *expr, int32 typmod)
Definition: nodeFuncs.c:582
Definition: nodes.h:487
unsigned int Oid
Definition: postgres_ext.h:31
Node * expression_tree_mutator(Node *node, Node *(*mutator)(), void *context)
Definition: nodeFuncs.c:2200
bool planstate_tree_walker(struct PlanState *planstate, bool(*walker)(), void *context)
Definition: nodeFuncs.c:3428
signed int int32
Definition: c.h:242
Oid exprType(const Node *expr)
Definition: nodeFuncs.c:41
bool exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod)
Definition: nodeFuncs.c:507
Node * query_or_expression_tree_mutator(Node *node, Node *(*mutator)(), void *context, int flags)
Definition: nodeFuncs.c:2969
Oid exprCollation(const Node *expr)
Definition: nodeFuncs.c:740
bool raw_expression_tree_walker(Node *node, bool(*walker)(), void *context)
Definition: nodeFuncs.c:2998
int32 exprTypmod(const Node *expr)
Definition: nodeFuncs.c:270
Node * strip_implicit_coercions(Node *node)
Definition: nodeFuncs.c:606
bool expression_returns_set(Node *clause)
Definition: nodeFuncs.c:664
bool query_tree_walker(Query *query, bool(*walker)(), void *context, int flags)
Definition: nodeFuncs.c:2041
bool expression_tree_walker(Node *node, bool(*walker)(), void *context)
Definition: nodeFuncs.c:1655
void exprSetInputCollation(Node *expr, Oid inputcollation)
Definition: nodeFuncs.c:1131
Oid exprInputCollation(const Node *expr)
Definition: nodeFuncs.c:936
List * range_table_mutator(List *rtable, Node *(*mutator)(), void *context, int flags)
Definition: nodeFuncs.c:2879
int exprLocation(const Node *expr)
Definition: nodeFuncs.c:1195
bool query_or_expression_tree_walker(Node *node, bool(*walker)(), void *context, int flags)
Definition: nodeFuncs.c:2946
void exprSetCollation(Node *expr, Oid collation)
Definition: nodeFuncs.c:984
bool range_table_walker(List *rtable, bool(*walker)(), void *context, int flags)
Definition: nodeFuncs.c:2085
Definition: pg_list.h:45