PostgreSQL Source Code
git master
|
#include "parser/parse_node.h"
Go to the source code of this file.
Functions | |
void | transformAggregateCall (ParseState *pstate, Aggref *agg, List *args, List *aggorder, bool agg_distinct) |
Node * | transformGroupingFunc (ParseState *pstate, GroupingFunc *p) |
void | transformWindowFuncCall (ParseState *pstate, WindowFunc *wfunc, WindowDef *windef) |
void | parseCheckAggregates (ParseState *pstate, Query *qry) |
List * | expand_grouping_sets (List *groupingSets, bool groupDistinct, int limit) |
int | get_aggregate_argtypes (Aggref *aggref, Oid *inputTypes) |
Oid | resolve_aggregate_transtype (Oid aggfuncid, Oid aggtranstype, Oid *inputTypes, int numArguments) |
bool | agg_args_support_sendreceive (Aggref *aggref) |
void | build_aggregate_transfn_expr (Oid *agg_input_types, int agg_num_inputs, int agg_num_direct_inputs, bool agg_variadic, Oid agg_state_type, Oid agg_input_collation, Oid transfn_oid, Oid invtransfn_oid, Expr **transfnexpr, Expr **invtransfnexpr) |
void | build_aggregate_serialfn_expr (Oid serialfn_oid, Expr **serialfnexpr) |
void | build_aggregate_deserialfn_expr (Oid deserialfn_oid, Expr **deserialfnexpr) |
void | build_aggregate_finalfn_expr (Oid *agg_input_types, int num_finalfn_inputs, Oid agg_state_type, Oid agg_result_type, Oid agg_input_collation, Oid finalfn_oid, Expr **finalfnexpr) |
Definition at line 2059 of file parse_agg.c.
References Aggref::args, elog, ERROR, TargetEntry::expr, exprType(), GETSTRUCT, HeapTupleIsValid, lfirst, ObjectIdGetDatum(), OidIsValid, ReleaseSysCache(), SearchSysCache1(), and type.
Referenced by preprocess_aggref().
Definition at line 2201 of file parse_agg.c.
References generate_unaccent_rules::args, COERCE_EXPLICIT_CALL, InvalidOid, list_make2, make_agg_arg(), and makeFuncExpr().
Referenced by build_pertrans_for_aggref().
void build_aggregate_finalfn_expr | ( | Oid * | agg_input_types, |
int | num_finalfn_inputs, | ||
Oid | agg_state_type, | ||
Oid | agg_result_type, | ||
Oid | agg_input_collation, | ||
Oid | finalfn_oid, | ||
Expr ** | finalfnexpr | ||
) |
Definition at line 2225 of file parse_agg.c.
References generate_unaccent_rules::args, COERCE_EXPLICIT_CALL, i, InvalidOid, lappend(), list_make1, make_agg_arg(), and makeFuncExpr().
Referenced by ExecInitAgg(), and initialize_peragg().
Definition at line 2178 of file parse_agg.c.
References generate_unaccent_rules::args, COERCE_EXPLICIT_CALL, InvalidOid, list_make1, make_agg_arg(), and makeFuncExpr().
Referenced by build_pertrans_for_aggref().
void build_aggregate_transfn_expr | ( | Oid * | agg_input_types, |
int | agg_num_inputs, | ||
int | agg_num_direct_inputs, | ||
bool | agg_variadic, | ||
Oid | agg_state_type, | ||
Oid | agg_input_collation, | ||
Oid | transfn_oid, | ||
Oid | invtransfn_oid, | ||
Expr ** | transfnexpr, | ||
Expr ** | invtransfnexpr | ||
) |
Definition at line 2117 of file parse_agg.c.
References generate_unaccent_rules::args, COERCE_EXPLICIT_CALL, i, InvalidOid, lappend(), list_make1, make_agg_arg(), makeFuncExpr(), and OidIsValid.
Referenced by build_pertrans_for_aggref(), and initialize_peragg().
Definition at line 1894 of file parse_agg.c.
References Assert, cmp_list_len_asc(), cmp_list_len_contents_asc(), equal(), expand_groupingset_node(), for_each_from, foreach_delete_current, lappend(), lfirst, linitial, list_int_cmp(), list_length(), list_sort(), list_union_int(), and NIL.
Referenced by parseCheckAggregates(), and preprocess_grouping_sets().
Definition at line 1997 of file parse_agg.c.
References Assert, FUNC_MAX_ARGS, lfirst_oid, and list_length().
Referenced by ExecInitAgg(), get_agg_expr_helper(), and preprocess_aggref().
void parseCheckAggregates | ( | ParseState * | pstate, |
Query * | qry | ||
) |
Definition at line 1085 of file parse_agg.c.
References addRangeTableEntryForGroup(), Assert, ereport, errcode(), errmsg(), ERROR, expand_grouping_sets(), TargetEntry::expr, exprLocation(), finalize_grouping_exprs(), flatten_join_alias_vars(), for_each_from, get_sortgroupclause_tle(), Query::groupClause, Query::groupDistinct, Query::groupingSets, Query::havingQual, IsA, lappend(), lfirst, linitial, list_intersection_int(), list_length(), list_member_int(), locate_agg_of_level(), NIL, ParseState::p_grouping_nsitem, ParseState::p_hasAggs, ParseState::p_rtable, parser_errposition(), TargetEntry::ressortgroupref, Query::rtable, RTE_CTE, RTE_JOIN, RangeTblEntry::rtekind, substitute_grouped_columns(), and Query::targetList.
Referenced by transformDeleteStmt(), transformPLAssignStmt(), transformSelectStmt(), and transformSetOperationStmt().
Oid resolve_aggregate_transtype | ( | Oid | aggfuncid, |
Oid | aggtranstype, | ||
Oid * | inputTypes, | ||
int | numArguments | ||
) |
Definition at line 2023 of file parse_agg.c.
References Assert, enforce_generic_type_consistency(), get_func_signature(), and pfree().
Referenced by initialize_peragg(), and preprocess_aggref().
void transformAggregateCall | ( | ParseState * | pstate, |
Aggref * | agg, | ||
List * | args, | ||
List * | aggorder, | ||
bool | agg_distinct | ||
) |
Definition at line 109 of file parse_agg.c.
References addTargetToSortList(), Aggref::aggdirectargs, Aggref::aggdistinct, Aggref::aggorder, arg, generate_unaccent_rules::args, Aggref::args, Assert, check_agglevels_and_constraints(), ereport, errcode(), errdetail(), errmsg(), ERROR, TargetEntry::expr, EXPR_KIND_ORDER_BY, exprLocation(), exprType(), forboth, format_type_be(), get_sortgroupclause_expr(), lappend(), lappend_oid(), lfirst, list_copy_tail(), list_length(), list_truncate(), makeTargetEntry(), NIL, OidIsValid, ParseState::p_next_resno, parser_errposition(), SortGroupClause::sortop, transformDistinctClause(), and transformSortClause().
Referenced by ParseFuncOrColumn(), and transformJsonAggConstructor().
Node* transformGroupingFunc | ( | ParseState * | pstate, |
GroupingFunc * | p | ||
) |
Definition at line 265 of file parse_agg.c.
References generate_unaccent_rules::args, check_agglevels_and_constraints(), ereport, errcode(), errmsg(), ERROR, lappend(), lfirst, list_length(), GroupingFunc::location, makeNode, NIL, ParseState::p_expr_kind, parser_errposition(), and transformExpr().
Referenced by transformExprRecurse().
void transformWindowFuncCall | ( | ParseState * | pstate, |
WindowFunc * | wfunc, | ||
WindowDef * | windef | ||
) |
Definition at line 825 of file parse_agg.c.
References _, WindowFunc::args, Assert, contain_windowfuncs(), WindowDef::endOffset, equal(), ereport, err(), errcode(), errmsg(), errmsg_internal(), ERROR, EXPR_KIND_ALTER_COL_TRANSFORM, EXPR_KIND_CALL_ARGUMENT, EXPR_KIND_CHECK_CONSTRAINT, EXPR_KIND_COLUMN_DEFAULT, EXPR_KIND_COPY_WHERE, EXPR_KIND_CYCLE_MARK, EXPR_KIND_DISTINCT_ON, EXPR_KIND_DOMAIN_CHECK, EXPR_KIND_EXECUTE_PARAMETER, EXPR_KIND_FILTER, EXPR_KIND_FROM_FUNCTION, EXPR_KIND_FROM_SUBSELECT, EXPR_KIND_FUNCTION_DEFAULT, EXPR_KIND_GENERATED_COLUMN, EXPR_KIND_GROUP_BY, EXPR_KIND_HAVING, EXPR_KIND_INDEX_EXPRESSION, EXPR_KIND_INDEX_PREDICATE, EXPR_KIND_INSERT_TARGET, EXPR_KIND_JOIN_ON, EXPR_KIND_JOIN_USING, EXPR_KIND_LIMIT, EXPR_KIND_MERGE_RETURNING, EXPR_KIND_MERGE_WHEN, EXPR_KIND_NONE, EXPR_KIND_OFFSET, EXPR_KIND_ORDER_BY, EXPR_KIND_OTHER, EXPR_KIND_PARTITION_BOUND, EXPR_KIND_PARTITION_EXPRESSION, EXPR_KIND_POLICY, EXPR_KIND_RETURNING, EXPR_KIND_SELECT_TARGET, EXPR_KIND_STATS_EXPRESSION, EXPR_KIND_TRIGGER_WHEN, EXPR_KIND_UPDATE_SOURCE, EXPR_KIND_UPDATE_TARGET, EXPR_KIND_VALUES, EXPR_KIND_VALUES_SINGLE, EXPR_KIND_WHERE, EXPR_KIND_WINDOW_FRAME_GROUPS, EXPR_KIND_WINDOW_FRAME_RANGE, EXPR_KIND_WINDOW_FRAME_ROWS, EXPR_KIND_WINDOW_ORDER, EXPR_KIND_WINDOW_PARTITION, FRAMEOPTION_DEFAULTS, WindowDef::frameOptions, lappend(), lfirst, list_length(), locate_windowfunc(), WindowDef::location, WindowFunc::location, WindowDef::name, NIL, WindowDef::orderClause, ParseState::p_expr_kind, ParseState::p_hasWindowFuncs, ParseState::p_windowdefs, ParseExprKindName(), parser_errposition(), WindowDef::partitionClause, WindowDef::refname, WindowDef::startOffset, and WindowFunc::winref.
Referenced by ParseFuncOrColumn(), and transformJsonAggConstructor().