#include "nodes/relation.h"
Go to the source code of this file.
Enumerations | |
enum | PVCAggregateBehavior { PVC_REJECT_AGGREGATES, PVC_INCLUDE_AGGREGATES, PVC_RECURSE_AGGREGATES } |
enum | PVCPlaceHolderBehavior { PVC_REJECT_PLACEHOLDERS, PVC_INCLUDE_PLACEHOLDERS, PVC_RECURSE_PLACEHOLDERS } |
Functions | |
Relids | pull_varnos (Node *node) |
Relids | pull_varnos_of_level (Node *node, int levelsup) |
void | pull_varattnos (Node *node, Index varno, Bitmapset **varattnos) |
List * | pull_vars_of_level (Node *node, int levelsup) |
bool | contain_var_clause (Node *node) |
bool | contain_vars_of_level (Node *node, int levelsup) |
int | locate_var_of_level (Node *node, int levelsup) |
List * | pull_var_clause (Node *node, PVCAggregateBehavior aggbehavior, PVCPlaceHolderBehavior phbehavior) |
Node * | flatten_join_alias_vars (PlannerInfo *root, Node *node) |
enum PVCAggregateBehavior |
Definition at line 19 of file var.h.
{ PVC_REJECT_AGGREGATES, /* throw error if Aggref found */ PVC_INCLUDE_AGGREGATES, /* include Aggrefs in output list */ PVC_RECURSE_AGGREGATES /* recurse into Aggref arguments */ } PVCAggregateBehavior;
Definition at line 26 of file var.h.
{ PVC_REJECT_PLACEHOLDERS, /* throw error if PlaceHolderVar found */ PVC_INCLUDE_PLACEHOLDERS, /* include PlaceHolderVars in output list */ PVC_RECURSE_PLACEHOLDERS /* recurse into PlaceHolderVar arguments */ } PVCPlaceHolderBehavior;
Definition at line 324 of file var.c.
References contain_var_clause_walker(), and NULL.
Referenced by cookDefault(), domainAddConstraint(), examine_parameter_list(), is_pseudo_constant_clause(), and match_clause_to_ordering_op().
{ return contain_var_clause_walker(node, NULL); }
Definition at line 362 of file var.c.
References contain_vars_of_level_walker(), and query_or_expression_tree_walker().
Referenced by checkExprIsVarFree(), convert_ANY_sublink_to_join(), convert_EXISTS_sublink_to_join(), convert_EXISTS_to_ANY(), make_restrictinfos_from_actual_clauses(), pullup_replace_vars_callback(), transformAExprIn(), transformRangeFunction(), transformSetOperationTree(), and transformValuesClause().
{ int sublevels_up = levelsup; return query_or_expression_tree_walker(node, contain_vars_of_level_walker, (void *) &sublevels_up, 0); }
Node* flatten_join_alias_vars | ( | PlannerInfo * | root, | |
Node * | node | |||
) |
Definition at line 608 of file var.c.
References flatten_join_alias_vars_mutator(), Query::hasSubLinks, flatten_join_alias_vars_context::inserted_sublink, PlannerInfo::parse, flatten_join_alias_vars_context::possible_sublink, flatten_join_alias_vars_context::root, and flatten_join_alias_vars_context::sublevels_up.
Referenced by parseCheckAggregates(), preprocess_expression(), and subquery_planner().
{ flatten_join_alias_vars_context context; context.root = root; context.sublevels_up = 0; /* flag whether join aliases could possibly contain SubLinks */ context.possible_sublink = root->parse->hasSubLinks; /* if hasSubLinks is already true, no need to work hard */ context.inserted_sublink = root->parse->hasSubLinks; return flatten_join_alias_vars_mutator(node, &context); }
int locate_var_of_level | ( | Node * | node, | |
int | levelsup | |||
) |
Definition at line 430 of file var.c.
References locate_var_of_level_walker(), query_or_expression_tree_walker(), locate_var_of_level_context::sublevels_up, and locate_var_of_level_context::var_location.
Referenced by checkExprIsVarFree(), and transformSetOperationTree().
{ locate_var_of_level_context context; context.var_location = -1; /* in case we find nothing */ context.sublevels_up = levelsup; (void) query_or_expression_tree_walker(node, locate_var_of_level_walker, (void *) &context, 0); return context.var_location; }
List* pull_var_clause | ( | Node * | node, | |
PVCAggregateBehavior | aggbehavior, | |||
PVCPlaceHolderBehavior | phbehavior | |||
) |
Definition at line 516 of file var.c.
References pull_var_clause_context::aggbehavior, pull_var_clause_context::phbehavior, pull_var_clause_walker(), and pull_var_clause_context::varlist.
Referenced by AddRelationNewConstraints(), build_base_rel_tlists(), CreateTrigger(), distribute_qual_to_rels(), estimate_num_groups(), fix_placeholder_input_needed_levels(), flatten_tlist(), generate_base_implied_equalities_no_const(), make_subplanTargetList(), make_windowInputTargetList(), mark_placeholders_in_expr(), prepare_sort_from_pathkeys(), preprocess_targetlist(), qual_is_pushdown_safe(), and StoreRelCheck().
{ pull_var_clause_context context; context.varlist = NIL; context.aggbehavior = aggbehavior; context.phbehavior = phbehavior; pull_var_clause_walker(node, &context); return context.varlist; }
Definition at line 212 of file var.c.
References pull_varattnos_walker(), pull_varattnos_context::varattnos, and pull_varattnos_context::varno.
Referenced by check_index_only(), check_selective_binary_conversion(), deparseReturningList(), postgresGetForeignRelSize(), and RelationGetIndexAttrBitmap().
{ pull_varattnos_context context; context.varattnos = *varattnos; context.varno = varno; (void) pull_varattnos_walker(node, &context); *varattnos = context.varattnos; }
Definition at line 96 of file var.c.
References pull_varnos_walker(), query_or_expression_tree_walker(), pull_varnos_context::sublevels_up, and pull_varnos_context::varnos.
Referenced by adjust_rowcompare_for_index(), convert_ANY_sublink_to_join(), convert_EXISTS_sublink_to_join(), create_unique_path(), distribute_qual_to_rels(), examine_variable(), find_placeholder_info(), get_eclass_for_sort_expr(), join_is_removable(), make_outerjoininfo(), make_restrictinfo_internal(), match_clause_to_indexcol(), match_rowcompare_to_indexcol(), NumRelids(), and reduce_outer_joins_pass2().
{ pull_varnos_context context; context.varnos = NULL; context.sublevels_up = 0; /* * Must be prepared to start with a Query or a bare expression tree; if * it's a Query, we don't want to increment sublevels_up. */ query_or_expression_tree_walker(node, pull_varnos_walker, (void *) &context, 0); return context.varnos; }
Definition at line 121 of file var.c.
References pull_varnos_walker(), query_or_expression_tree_walker(), pull_varnos_context::sublevels_up, and pull_varnos_context::varnos.
Referenced by is_simple_subquery().
{ pull_varnos_context context; context.varnos = NULL; context.sublevels_up = levelsup; /* * Must be prepared to start with a Query or a bare expression tree; if * it's a Query, we don't want to increment sublevels_up. */ query_or_expression_tree_walker(node, pull_varnos_walker, (void *) &context, 0); return context.varnos; }
Definition at line 256 of file var.c.
References pull_vars_walker(), query_or_expression_tree_walker(), pull_vars_context::sublevels_up, and pull_vars_context::vars.
Referenced by extract_lateral_references().
{ pull_vars_context context; context.vars = NIL; context.sublevels_up = levelsup; /* * Must be prepared to start with a Query or a bare expression tree; if * it's a Query, we don't want to increment sublevels_up. */ query_or_expression_tree_walker(node, pull_vars_walker, (void *) &context, 0); return context.vars; }