22 #define QTW_IGNORE_RT_SUBQUERIES 0x01
23 #define QTW_IGNORE_CTE_SUBQUERIES 0x02
24 #define QTW_IGNORE_RC_SUBQUERIES 0x03
25 #define QTW_IGNORE_JOINALIASES 0x04
26 #define QTW_IGNORE_RANGE_TABLE 0x08
27 #define QTW_EXAMINE_RTES_BEFORE 0x10
29 #define QTW_EXAMINE_RTES_AFTER 0x20
31 #define QTW_DONT_COPY_QUERY 0x40
32 #define QTW_EXAMINE_SORTGROUP 0x80
34 #define QTW_IGNORE_GROUPEXPRS 0x100
80 return clause != NULL &&
IsA(clause,
OpExpr);
111 return (clause != NULL &&
120 return (clause != NULL &&
129 return (clause != NULL &&
155 #define expression_tree_walker(n, w, c) \
156 expression_tree_walker_impl(n, (tree_walker_callback) (w), c)
157 #define expression_tree_mutator(n, m, c) \
158 expression_tree_mutator_impl(n, (tree_mutator_callback) (m), c)
160 #define query_tree_walker(q, w, c, f) \
161 query_tree_walker_impl(q, (tree_walker_callback) (w), c, f)
162 #define query_tree_mutator(q, m, c, f) \
163 query_tree_mutator_impl(q, (tree_mutator_callback) (m), c, f)
165 #define range_table_walker(rt, w, c, f) \
166 range_table_walker_impl(rt, (tree_walker_callback) (w), c, f)
167 #define range_table_mutator(rt, m, c, f) \
168 range_table_mutator_impl(rt, (tree_mutator_callback) (m), c, f)
170 #define range_table_entry_walker(r, w, c, f) \
171 range_table_entry_walker_impl(r, (tree_walker_callback) (w), c, f)
173 #define query_or_expression_tree_walker(n, w, c, f) \
174 query_or_expression_tree_walker_impl(n, (tree_walker_callback) (w), c, f)
175 #define query_or_expression_tree_mutator(n, m, c, f) \
176 query_or_expression_tree_mutator_impl(n, (tree_mutator_callback) (m), c, f)
178 #define raw_expression_tree_walker(n, w, c) \
179 raw_expression_tree_walker_impl(n, (tree_walker_callback) (w), c)
181 #define planstate_tree_walker(ps, w, c) \
182 planstate_tree_walker_impl(ps, (planstate_tree_walker_callback) (w), c)
Datum boolop(PG_FUNCTION_ARGS)
bool query_tree_walker_impl(Query *query, tree_walker_callback walker, void *context, int flags)
static bool is_andclause(const void *clause)
bool raw_expression_tree_walker_impl(Node *node, tree_walker_callback walker, void *context)
static Expr * get_notclausearg(const void *notclause)
static bool is_orclause(const void *clause)
Node * query_or_expression_tree_mutator_impl(Node *node, tree_mutator_callback mutator, void *context, int flags)
Oid exprType(const Node *expr)
bool(* planstate_tree_walker_callback)(struct PlanState *planstate, void *context)
bool planstate_tree_walker_impl(struct PlanState *planstate, planstate_tree_walker_callback walker, void *context)
bool range_table_entry_walker_impl(RangeTblEntry *rte, tree_walker_callback walker, void *context, int flags)
Query * query_tree_mutator_impl(Query *query, tree_mutator_callback mutator, void *context, int flags)
bool exprIsLengthCoercion(const Node *expr, int32 *coercedTypmod)
void exprSetCollation(Node *expr, Oid collation)
Oid exprInputCollation(const Node *expr)
Node * expression_tree_mutator_impl(Node *node, tree_mutator_callback mutator, void *context)
static bool is_opclause(const void *clause)
bool(* tree_walker_callback)(Node *node, void *context)
static Node * get_rightop(const void *clause)
int32 exprTypmod(const Node *expr)
bool check_functions_in_node(Node *node, check_function_callback checker, void *context)
Oid exprCollation(const Node *expr)
Node *(* tree_mutator_callback)(Node *node, void *context)
void exprSetInputCollation(Node *expr, Oid inputcollation)
bool query_or_expression_tree_walker_impl(Node *node, tree_walker_callback walker, void *context, int flags)
List * range_table_mutator_impl(List *rtable, tree_mutator_callback mutator, void *context, int flags)
Node * applyRelabelType(Node *arg, Oid rtype, int32 rtypmod, Oid rcollid, CoercionForm rformat, int rlocation, bool overwrite_ok)
bool expression_tree_walker_impl(Node *node, tree_walker_callback walker, void *context)
static bool is_funcclause(const void *clause)
bool range_table_walker_impl(List *rtable, tree_walker_callback walker, void *context, int flags)
static bool is_notclause(const void *clause)
bool(* check_function_callback)(Oid func_id, void *context)
Node * relabel_to_typmod(Node *expr, int32 typmod)
int exprLocation(const Node *expr)
Node * strip_implicit_coercions(Node *node)
bool expression_returns_set(Node *clause)
void fix_opfuncids(Node *node)
static Node * get_leftop(const void *clause)
void set_sa_opfuncid(ScalarArrayOpExpr *opexpr)
void set_opfuncid(OpExpr *opexpr)
#define IsA(nodeptr, _type_)
static int list_length(const List *l)