PostgreSQL Source Code
git master
|
#include "nodes/parsenodes.h"
Go to the source code of this file.
Data Structures | |
struct | replace_rte_variables_context |
Typedefs | |
typedef struct replace_rte_variables_context | replace_rte_variables_context |
typedef Node *(* | replace_rte_variables_callback) (Var *var, replace_rte_variables_context *context) |
typedef enum ReplaceVarsNoMatchOption | ReplaceVarsNoMatchOption |
Enumerations | |
enum | ReplaceVarsNoMatchOption { REPLACEVARS_REPORT_ERROR, REPLACEVARS_CHANGE_VARNO, REPLACEVARS_SUBSTITUTE_NULL } |
Functions | |
void | OffsetVarNodes (Node *node, int offset, int sublevels_up) |
void | ChangeVarNodes (Node *node, int old_varno, int new_varno, int sublevels_up) |
void | IncrementVarSublevelsUp (Node *node, int delta_sublevels_up, int min_sublevels_up) |
void | IncrementVarSublevelsUp_rtable (List *rtable, int delta_sublevels_up, int min_sublevels_up) |
bool | rangeTableEntry_used (Node *node, int rt_index, int sublevels_up) |
Query * | getInsertSelectQuery (Query *parsetree, Query ***subquery_ptr) |
void | AddQual (Query *parsetree, Node *qual) |
void | AddInvertedQual (Query *parsetree, Node *qual) |
bool | contain_aggs_of_level (Node *node, int levelsup) |
int | locate_agg_of_level (Node *node, int levelsup) |
bool | contain_windowfuncs (Node *node) |
int | locate_windowfunc (Node *node) |
bool | checkExprHasSubLink (Node *node) |
Node * | replace_rte_variables (Node *node, int target_varno, int sublevels_up, replace_rte_variables_callback callback, void *callback_arg, bool *outer_hasSubLinks) |
Node * | replace_rte_variables_mutator (Node *node, replace_rte_variables_context *context) |
Node * | map_variable_attnos (Node *node, int target_varno, int sublevels_up, const struct AttrMap *attno_map, Oid to_rowtype, bool *found_whole_row) |
Node * | ReplaceVarsFromTargetList (Node *node, int target_varno, int sublevels_up, RangeTblEntry *target_rte, List *targetlist, ReplaceVarsNoMatchOption nomatch_option, int nomatch_varno, bool *outer_hasSubLinks) |
typedef Node*(* replace_rte_variables_callback) (Var *var, replace_rte_variables_context *context) |
Definition at line 24 of file rewriteManip.h.
typedef struct replace_rte_variables_context replace_rte_variables_context |
Definition at line 22 of file rewriteManip.h.
typedef enum ReplaceVarsNoMatchOption ReplaceVarsNoMatchOption |
Enumerator | |
---|---|
REPLACEVARS_REPORT_ERROR | |
REPLACEVARS_CHANGE_VARNO | |
REPLACEVARS_SUBSTITUTE_NULL |
Definition at line 36 of file rewriteManip.h.
Definition at line 1047 of file rewriteManip.c.
References AddQual(), BooleanTest::arg, BooleanTest::booltesttype, IS_NOT_TRUE, BooleanTest::location, and makeNode.
Referenced by CopyAndAddInvertedQual().
Definition at line 979 of file rewriteManip.c.
References Assert, checkExprHasSubLink(), CMD_UTILITY, Query::commandType, contain_aggs_of_level(), copyObject, ereport, errcode(), errmsg(), ERROR, Query::hasSubLinks, IsA, Query::jointree, make_and_qual(), FromExpr::quals, Query::setOperations, and Query::utilityStmt.
Referenced by AddInvertedQual(), rewriteRuleAction(), and rewriteTargetView().
void ChangeVarNodes | ( | Node * | node, |
int | old_varno, | ||
int | new_varno, | ||
int | sublevels_up | ||
) |
Definition at line 610 of file rewriteManip.c.
References ChangeVarNodes_walker(), OnConflictExpr::exclRelIndex, IsA, lfirst, ChangeVarNodes_context::new_index, Query::onConflict, query_tree_walker(), Query::resultRelation, Query::rowMarks, ChangeVarNodes_context::rt_index, RowMarkClause::rti, and ChangeVarNodes_context::sublevels_up.
Referenced by add_security_quals(), add_with_check_options(), ApplyRetrieveRule(), CopyAndAddInvertedQual(), get_relation_constraints(), get_relation_info(), inheritance_planner(), rewriteRuleAction(), rewriteTargetView(), set_baserel_partition_constraint(), set_baserel_partition_key_exprs(), and TriggerEnabled().
Definition at line 277 of file rewriteManip.c.
References checkExprHasSubLink_walker(), QTW_IGNORE_RC_SUBQUERIES, and query_or_expression_tree_walker().
Referenced by AddQual(), flatten_join_alias_vars_mutator(), RelationBuildRowSecurity(), replace_rte_variables_mutator(), rewriteRuleAction(), and rewriteTargetView().
Definition at line 67 of file rewriteManip.c.
References contain_aggs_of_level_walker(), query_or_expression_tree_walker(), and contain_aggs_of_level_context::sublevels_up.
Referenced by AddQual(), checkTargetlistEntrySQL92(), and convert_EXISTS_to_ANY().
Definition at line 197 of file rewriteManip.c.
References contain_windowfuncs_walker(), and query_or_expression_tree_walker().
Referenced by checkTargetlistEntrySQL92(), contain_window_function(), and transformWindowFuncCall().
Definition at line 924 of file rewriteManip.c.
References Assert, CMD_INSERT, CMD_SELECT, Query::commandType, elog, ERROR, FromExpr::fromlist, IsA, Query::jointree, linitial, list_length(), PRS2_NEW_VARNO, PRS2_OLD_VARNO, rt_fetch, Query::rtable, RangeTblRef::rtindex, and RangeTblEntry::subquery.
Referenced by DefineQueryRewrite(), InsertRule(), make_ruledef(), rewriteRuleAction(), and transformRuleStmt().
void IncrementVarSublevelsUp | ( | Node * | node, |
int | delta_sublevels_up, | ||
int | min_sublevels_up | ||
) |
Definition at line 776 of file rewriteManip.c.
References IncrementVarSublevelsUp_context::delta_sublevels_up, IncrementVarSublevelsUp_walker(), IncrementVarSublevelsUp_context::min_sublevels_up, QTW_EXAMINE_RTES_BEFORE, and query_or_expression_tree_walker().
Referenced by assign_param_for_placeholdervar(), build_minmax_path(), convert_EXISTS_sublink_to_join(), convert_EXISTS_to_ANY(), extract_lateral_references(), flatten_join_alias_vars_mutator(), inline_cte_walker(), pull_up_simple_subquery(), pullup_replace_vars_callback(), replace_outer_agg(), replace_outer_grouping(), ReplaceVarsFromTargetList_callback(), and substitute_actual_srf_parameters_mutator().
void IncrementVarSublevelsUp_rtable | ( | List * | rtable, |
int | delta_sublevels_up, | ||
int | min_sublevels_up | ||
) |
Definition at line 799 of file rewriteManip.c.
References IncrementVarSublevelsUp_context::delta_sublevels_up, IncrementVarSublevelsUp_walker(), IncrementVarSublevelsUp_context::min_sublevels_up, QTW_EXAMINE_RTES_BEFORE, and range_table_walker().
Referenced by pull_up_simple_union_all().
int locate_agg_of_level | ( | Node * | node, |
int | levelsup | ||
) |
Definition at line 131 of file rewriteManip.c.
References locate_agg_of_level_context::agg_location, locate_agg_of_level_walker(), query_or_expression_tree_walker(), and locate_agg_of_level_context::sublevels_up.
Referenced by check_agg_arguments(), checkTargetlistEntrySQL92(), and parseCheckAggregates().
int locate_windowfunc | ( | Node * | node | ) |
Definition at line 235 of file rewriteManip.c.
References locate_windowfunc_walker(), query_or_expression_tree_walker(), and locate_windowfunc_context::win_location.
Referenced by checkTargetlistEntrySQL92(), and transformWindowFuncCall().
Node* map_variable_attnos | ( | Node * | node, |
int | target_varno, | ||
int | sublevels_up, | ||
const struct AttrMap * | attno_map, | ||
Oid | to_rowtype, | ||
bool * | found_whole_row | ||
) |
void OffsetVarNodes | ( | Node * | node, |
int | offset, | ||
int | sublevels_up | ||
) |
Definition at line 425 of file rewriteManip.c.
References OnConflictExpr::exclRelIndex, IsA, lfirst, OffsetVarNodes_context::offset, OffsetVarNodes_walker(), Query::onConflict, query_tree_walker(), Query::resultRelation, Query::rowMarks, RowMarkClause::rti, and OffsetVarNodes_context::sublevels_up.
Referenced by convert_EXISTS_sublink_to_join(), pull_up_simple_subquery(), rewriteRuleAction(), and UpdateRangeTableOfViewParse().
Definition at line 892 of file rewriteManip.c.
References query_or_expression_tree_walker(), rangeTableEntry_used_walker(), rangeTableEntry_used_context::rt_index, and rangeTableEntry_used_context::sublevels_up.
Referenced by fireRIRrules(), matchLocks(), rewriteRuleAction(), and transformRuleStmt().
Node* replace_rte_variables | ( | Node * | node, |
int | target_varno, | ||
int | sublevels_up, | ||
replace_rte_variables_callback | callback, | ||
void * | callback_arg, | ||
bool * | outer_hasSubLinks | ||
) |
Definition at line 1087 of file rewriteManip.c.
References replace_rte_variables_context::callback, callback(), replace_rte_variables_context::callback_arg, elog, ERROR, replace_rte_variables_context::inserted_sublink, IsA, query_or_expression_tree_mutator(), replace_rte_variables_mutator(), replace_rte_variables_context::sublevels_up, and replace_rte_variables_context::target_varno.
Referenced by pullup_replace_vars(), pullup_replace_vars_subquery(), and ReplaceVarsFromTargetList().
Node* replace_rte_variables_mutator | ( | Node * | node, |
replace_rte_variables_context * | context | ||
) |
Definition at line 1134 of file rewriteManip.c.
References replace_rte_variables_context::callback, checkExprHasSubLink(), CurrentOfExpr::cvarno, ereport, errcode(), errmsg(), ERROR, expression_tree_mutator(), Query::hasSubLinks, replace_rte_variables_context::inserted_sublink, IsA, query_tree_mutator(), replace_rte_variables_mutator(), replace_rte_variables_context::sublevels_up, replace_rte_variables_context::target_varno, Var::varlevelsup, and Var::varno.
Referenced by pullup_replace_vars_callback(), replace_rte_variables(), replace_rte_variables_mutator(), and ReplaceVarsFromTargetList_callback().
Node* ReplaceVarsFromTargetList | ( | Node * | node, |
int | target_varno, | ||
int | sublevels_up, | ||
RangeTblEntry * | target_rte, | ||
List * | targetlist, | ||
ReplaceVarsNoMatchOption | nomatch_option, | ||
int | nomatch_varno, | ||
bool * | outer_hasSubLinks | ||
) |
Definition at line 1514 of file rewriteManip.c.
References ReplaceVarsFromTargetList_context::nomatch_option, ReplaceVarsFromTargetList_context::nomatch_varno, replace_rte_variables(), ReplaceVarsFromTargetList_callback(), ReplaceVarsFromTargetList_context::target_rte, and ReplaceVarsFromTargetList_context::targetlist.
Referenced by CopyAndAddInvertedQual(), rewriteRuleAction(), rewriteTargetView(), and subquery_push_qual().