PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/sysattr.h"
#include "nodes/nodeFuncs.h"
#include "optimizer/optimizer.h"
#include "optimizer/placeholder.h"
#include "optimizer/prep.h"
#include "parser/parsetree.h"
#include "rewrite/rewriteManip.h"
Go to the source code of this file.
Data Structures | |
struct | pull_varnos_context |
struct | pull_varattnos_context |
struct | pull_vars_context |
struct | locate_var_of_level_context |
struct | pull_var_clause_context |
struct | flatten_join_alias_vars_context |
Definition at line 880 of file var.c.
References bms_add_member(), bms_join(), bms_next_member(), get_relids_for_join(), rt_fetch, Query::rtable, RTE_JOIN, and RangeTblEntry::rtekind.
Referenced by flatten_join_alias_vars_mutator().
Definition at line 393 of file var.c.
References contain_var_clause_walker().
Referenced by contain_leaked_vars_walker(), cookDefault(), domainAddConstraint(), interpret_function_parameter_list(), is_pseudo_constant_clause(), match_clause_to_ordering_op(), match_clause_to_partition_key(), test_opexpr_is_hashable(), and transformPartitionBoundValue().
Definition at line 399 of file var.c.
References expression_tree_walker, and IsA.
Referenced by contain_var_clause().
Definition at line 431 of file var.c.
References contain_vars_of_level_walker(), and query_or_expression_tree_walker.
Referenced by apply_child_basequals(), checkExprIsVarFree(), convert_ANY_sublink_to_join(), convert_EXISTS_sublink_to_join(), convert_EXISTS_to_ANY(), pull_up_simple_values(), pullup_replace_vars_callback(), transformAExprIn(), transformRangeFunction(), transformRangeTableFunc(), transformSetOperationTree(), and transformValuesClause().
Definition at line 442 of file var.c.
References expression_tree_walker, IsA, and query_tree_walker.
Referenced by contain_vars_of_level().
Definition at line 726 of file var.c.
References flatten_join_alias_vars_mutator(), Query::hasSubLinks, flatten_join_alias_vars_context::inserted_sublink, flatten_join_alias_vars_context::possible_sublink, flatten_join_alias_vars_context::query, and flatten_join_alias_vars_context::sublevels_up.
Referenced by finalize_grouping_exprs_walker(), parseCheckAggregates(), preprocess_expression(), pull_up_simple_subquery(), and subquery_planner().
|
static |
Definition at line 741 of file var.c.
References alias_relid_set(), RowExpr::args, Assert(), checkExprHasSubLink(), COERCE_IMPLICIT_CAST, Alias::colnames, RowExpr::colnames, copyObject, RangeTblEntry::eref, expression_tree_mutator, forboth, Query::hasSubLinks, IncrementVarSublevelsUp(), flatten_join_alias_vars_context::inserted_sublink, InvalidAttrNumber, IsA, RangeTblEntry::joinaliasvars, lappend(), lfirst, list_length(), list_nth(), Var::location, RowExpr::location, makeNode, NIL, PlaceHolderVar::phlevelsup, flatten_join_alias_vars_context::possible_sublink, QTW_IGNORE_JOINALIASES, flatten_join_alias_vars_context::query, query_tree_mutator, RowExpr::row_format, RowExpr::row_typeid, rt_fetch, Query::rtable, RTE_JOIN, RangeTblEntry::rtekind, flatten_join_alias_vars_context::sublevels_up, Var::varattno, Var::varlevelsup, Var::varno, and Var::vartype.
Referenced by flatten_join_alias_vars().
int locate_var_of_level | ( | Node * | node, |
int | levelsup | ||
) |
Definition at line 499 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 check_agg_arguments(), checkExprIsVarFree(), and transformSetOperationTree().
|
static |
Definition at line 515 of file var.c.
References expression_tree_walker, IsA, Var::location, query_tree_walker, locate_var_of_level_context::sublevels_up, locate_var_of_level_context::var_location, and Var::varlevelsup.
Referenced by locate_var_of_level().
Definition at line 597 of file var.c.
References Assert(), pull_var_clause_context::flags, NIL, pull_var_clause_walker(), PVC_INCLUDE_AGGREGATES, PVC_INCLUDE_PLACEHOLDERS, PVC_INCLUDE_WINDOWFUNCS, PVC_RECURSE_AGGREGATES, PVC_RECURSE_PLACEHOLDERS, PVC_RECURSE_WINDOWFUNCS, and pull_var_clause_context::varlist.
Referenced by add_paths_with_pathkeys_for_rel(), AddRelationNewConstraints(), build_base_rel_tlists(), build_remote_returning(), build_tlist_to_deparse(), CreateTriggerFiringOn(), dependency_is_compatible_expression(), distribute_qual_to_rels(), estimate_num_groups(), find_computable_ec_member(), find_placeholders_in_expr(), fix_placeholder_input_needed_levels(), foreign_grouping_ok(), generate_base_implied_equalities_no_const(), make_group_input_target(), make_partial_grouping_target(), make_sort_input_target(), make_window_input_target(), preprocess_targetlist(), process_implied_equality(), qual_is_pushdown_safe(), and StoreRelCheck().
|
static |
Definition at line 617 of file var.c.
References elog(), ERROR, expression_tree_walker, pull_var_clause_context::flags, IsA, lappend(), PVC_INCLUDE_AGGREGATES, PVC_INCLUDE_PLACEHOLDERS, PVC_INCLUDE_WINDOWFUNCS, PVC_RECURSE_AGGREGATES, PVC_RECURSE_PLACEHOLDERS, PVC_RECURSE_WINDOWFUNCS, and pull_var_clause_context::varlist.
Referenced by pull_var_clause().
Definition at line 281 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(), ComputePartitionAttrs(), create_foreignscan_plan(), CreateStatistics(), DefineIndex(), deparseReturningList(), ExecInitStoredGenerated(), get_dependent_generated_columns(), has_partition_attrs(), postgresGetForeignRelSize(), RelationGetIndexAttrBitmap(), remove_unused_subquery_outputs(), and statext_is_compatible_clause().
|
static |
Definition at line 294 of file var.c.
References Assert(), bms_add_member(), expression_tree_walker, FirstLowInvalidHeapAttributeNumber, IsA, Var::varattno, pull_varattnos_context::varattnos, Var::varlevelsup, pull_varattnos_context::varno, and Var::varno.
Referenced by pull_varattnos().
Relids pull_varnos | ( | PlannerInfo * | root, |
Node * | node | ||
) |
Definition at line 100 of file var.c.
References pull_varnos_walker(), query_or_expression_tree_walker, pull_varnos_context::root, pull_varnos_context::sublevels_up, and pull_varnos_context::varnos.
Referenced by compute_semijoin_info(), convert_ANY_sublink_to_join(), convert_EXISTS_sublink_to_join(), cost_incremental_sort(), distribute_qual_to_rels(), examine_variable(), expand_indexqual_rowcompare(), find_placeholder_info(), get_eclass_for_sort_expr(), is_pseudo_constant_for_index(), IsTidEqualAnyClause(), join_is_removable(), make_outerjoininfo(), make_restrictinfo_internal(), match_rowcompare_to_indexcol(), match_saopclause_to_indexcol(), NumRelids(), pg_get_expr_worker(), process_implied_equality(), and pullup_replace_vars_callback().
Relids pull_varnos_of_level | ( | PlannerInfo * | root, |
Node * | node, | ||
int | levelsup | ||
) |
Definition at line 126 of file var.c.
References pull_varnos_walker(), query_or_expression_tree_walker, pull_varnos_context::root, pull_varnos_context::sublevels_up, and pull_varnos_context::varnos.
Referenced by is_simple_subquery(), and jointree_contains_lateral_outer_refs().
|
static |
Definition at line 147 of file var.c.
References bms_add_member(), bms_add_members(), bms_difference(), bms_equal(), bms_join(), CurrentOfExpr::cvarno, expression_tree_walker, IsA, PlaceHolderInfo::ph_eval_at, PlaceHolderInfo::ph_var, PlaceHolderVar::phid, PlaceHolderVar::phlevelsup, query_tree_walker, pull_varnos_context::root, pull_varnos_context::sublevels_up, Var::varlevelsup, Var::varno, and pull_varnos_context::varnos.
Referenced by pull_varnos(), and pull_varnos_of_level().
Definition at line 325 of file var.c.
References NIL, pull_vars_walker(), query_or_expression_tree_walker, pull_vars_context::sublevels_up, and pull_vars_context::vars.
Referenced by extract_lateral_references().
|
static |
Definition at line 345 of file var.c.
References expression_tree_walker, IsA, lappend(), PlaceHolderVar::phlevelsup, query_tree_walker, pull_vars_context::sublevels_up, Var::varlevelsup, and pull_vars_context::vars.
Referenced by pull_vars_of_level().