PostgreSQL Source Code  git master
parse_agg.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * parse_agg.h
4  * handle aggregates and window functions in parser
5  *
6  * Portions Copyright (c) 1996-2024, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/parser/parse_agg.h
10  *
11  *-------------------------------------------------------------------------
12  */
13 #ifndef PARSE_AGG_H
14 #define PARSE_AGG_H
15 
16 #include "parser/parse_node.h"
17 
18 extern void transformAggregateCall(ParseState *pstate, Aggref *agg,
19  List *args, List *aggorder,
20  bool agg_distinct);
21 
23 
24 extern void transformWindowFuncCall(ParseState *pstate, WindowFunc *wfunc,
25  WindowDef *windef);
26 
27 extern void parseCheckAggregates(ParseState *pstate, Query *qry);
28 
29 extern List *expand_grouping_sets(List *groupingSets, bool groupDistinct, int limit);
30 
31 extern int get_aggregate_argtypes(Aggref *aggref, Oid *inputTypes);
32 
33 extern Oid resolve_aggregate_transtype(Oid aggfuncid,
34  Oid aggtranstype,
35  Oid *inputTypes,
36  int numArguments);
37 
38 extern bool agg_args_support_sendreceive(Aggref *aggref);
39 
40 extern void build_aggregate_transfn_expr(Oid *agg_input_types,
41  int agg_num_inputs,
42  int agg_num_direct_inputs,
43  bool agg_variadic,
44  Oid agg_state_type,
45  Oid agg_input_collation,
46  Oid transfn_oid,
47  Oid invtransfn_oid,
48  Expr **transfnexpr,
49  Expr **invtransfnexpr);
50 
51 extern void build_aggregate_serialfn_expr(Oid serialfn_oid,
52  Expr **serialfnexpr);
53 
54 extern void build_aggregate_deserialfn_expr(Oid deserialfn_oid,
55  Expr **deserialfnexpr);
56 
57 extern void build_aggregate_finalfn_expr(Oid *agg_input_types,
58  int num_finalfn_inputs,
59  Oid agg_state_type,
60  Oid agg_result_type,
61  Oid agg_input_collation,
62  Oid finalfn_oid,
63  Expr **finalfnexpr);
64 
65 #endif /* PARSE_AGG_H */
Node * transformGroupingFunc(ParseState *pstate, GroupingFunc *p)
Definition: parse_agg.c:265
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: parse_agg.c:2225
List * expand_grouping_sets(List *groupingSets, bool groupDistinct, int limit)
Definition: parse_agg.c:1894
Oid resolve_aggregate_transtype(Oid aggfuncid, Oid aggtranstype, Oid *inputTypes, int numArguments)
Definition: parse_agg.c:2023
void build_aggregate_deserialfn_expr(Oid deserialfn_oid, Expr **deserialfnexpr)
Definition: parse_agg.c:2201
void transformWindowFuncCall(ParseState *pstate, WindowFunc *wfunc, WindowDef *windef)
Definition: parse_agg.c:825
void parseCheckAggregates(ParseState *pstate, Query *qry)
Definition: parse_agg.c:1085
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: parse_agg.c:2117
void transformAggregateCall(ParseState *pstate, Aggref *agg, List *args, List *aggorder, bool agg_distinct)
Definition: parse_agg.c:109
bool agg_args_support_sendreceive(Aggref *aggref)
Definition: parse_agg.c:2059
int get_aggregate_argtypes(Aggref *aggref, Oid *inputTypes)
Definition: parse_agg.c:1997
void build_aggregate_serialfn_expr(Oid serialfn_oid, Expr **serialfnexpr)
Definition: parse_agg.c:2178
unsigned int Oid
Definition: postgres_ext.h:31
Definition: pg_list.h:54
Definition: nodes.h:129